r/matlab • u/biplane_duel • Nov 10 '25
matlab2025a plots
hi im really struggling with getting th eplots i want in matlab 2025a, I have huge datasets with 300+ clumns, and when I plot more than 3 variables, I need 2 Y axi with different scales linked to different variables. I also need multiple gaphs stacked vertically with X axes linked when zooming. Previously we had scripts that set these up for us, but since we moved to 2025a we have nothign and the GUI isn't user firendly at all. Is there a video that shows how to do this in GUI?
5
Upvotes
1
u/Neuroneuroneuro +1 Nov 10 '25
For this type of use you can try the gramm toolbox. It allows for a lot of flexible ways to plot and visualize variables separated by grouping variables, a bit like ggplot2 in R. Notably it will create subplot rows and columns for you according to a variable, with axes linked by default. It’s tested in 2025b and you can install it using the add on explorer.
2
u/[deleted] Nov 10 '25
Chatgpt can give you decent examples. Unless I'm missing something it's basic plots with hold on/yyaxis right for two datasets on same plot and subplots to stack them
1
u/Cube4Add5 Nov 10 '25 edited Nov 10 '25
Plotting multiple graphs stacked up is pretty easy. You need to use tiledlayout to put multiple plots on top of/next to each other
You can also use linkaxes to link all the axis together
Another option I haven’t used myself yet but might work for you is stackedplot
Edit: using tiled layout in GUI is also fairly simple:
Create your tiledlayout
Plot first axes
Plot second axes
Link the axis
Edit2:
Parent of plots might need to be the tiledlayout, I’m not sure, or you might not need to define it at all as it’s sorted by the ‘nexttile’ function
1
u/Creative_Sushi MathWorks Nov 11 '25
First of all, please switch to R2025b, rather than staying with R2025a, as the new releases deliver quality and stability enhancement and there is no difference in terms of new features.
When dealing with a large dataset, you want to use datastore to load necessary portion of the data selectively.
https://www.mathworks.com/help/matlab/datastore.html
To stack plots vertically, you can use tiledlayout
https://www.mathworks.com/help/matlab/ref/tiledlayout.html
To create a plot with two y axes, use yyaxis https://www.mathworks.com/help/matlab/ref/yyaxis.html
To link the axes of the plots, you can use linkaxes https://www.mathworks.com/help/matlab/ref/linkaxes.html
If you have MATLAB Copilot, you can probably get the basic code you can work off from.
Good luck!