Matlab : How to show multiple plots in one single figure with nice navigation like scrolling? - matlab

I have a large matrix that I compare each column for dependencies. (70 x 70 matrix)I want to show all the correlation plots to be able to interpret data visually. But it seems that matlab provides me a figure with many single lines and I cannot view them clearly. Are there any solutions like scrolling into one figure?

I believe the Scroll SubPlot submission to the file exchange is what you are looking for.

Related

Arraging multiple 3D plots

I have created 6 3D plots that I need to include in a research paper. However, I need to all the plots in a grid.
I've been trying the function subplot but all my plots are combining instead of forming a grid. I have tried setting nrows to various numbers but it does not change the layout. Any ideas on how to fix this? Or other functions that may serve the same purpose?
Shows the function for 1/6 plots, then the subplot function. to the right is the output:

Irregular scaling of MATLAB figure axes

During my work, I got the figure shown below
It is clear that it turns out to be a mess below 5 on the y-axis. What I want to do, is to "expand" the y-axis only in the range from 3 to 5 such that the lines are separated and can be clearly distinguished.
I tried using set(gca, 'Xtick', [0 1 2 3:.5:5 5:25]) but this didn't help at all.
Any hint is appreciated.
What I got is as shown in the figure below:
Since I am getting my data through iterative loops and even sub-loops, I couldn't manage to get the desired figure using "inset plot", it got so complicated. However, what I did is simply that I had two MATLAB figures, the original one and another copy of it with a zoom-in of the y-axis from 3.5 to 5, then I copied the zoomed one to the original one and that's it.
This practice is better than using power point or paint to get the figure since doing so in MATLAB gives MUCH more flexibility in terms of editing the two figures, resizing them, axes labeling and so on.
Hope this would help someone else.

Visually Comparable Plot

So I have to plot certain data (90 sets total) and a single set looks like this.
However when I hold on and plot 90 sets superimposed, it looks just like a patch of multiple colours.
Now what would be the most optimal way to represent the plots that can let us compare them and study the difference. For example (and this is just my thought and I am open to opnions) how can I compare these 90 plots in a Matrix fashion viz.
Is there even better ways to represent such collection of plots instead of just superimposing them?
EDIT: To clear things up, I have 90 graphs that look similar to the first graph and I have to compare them in say, a single page. What would be the best way to do it? Also is subplot the best idea for 90 graphs?
Thanks.
You need subplot(), which allows you to plot multiple figures in one window.
http://www.mathworks.com/help/matlab/ref/subplot.html?requestedDomain=www.mathworks.com

How to combine different figures in a Matlab script?

I am workin on a some sort of System test wherein i have a set of readings in the form of a .mat file.
It has a structure in the .mat file with one field as Measurement. It has several Arrays(e.g air mass flow, velocity, carbon content) which further have fields like time and value.
From these, I Need to plot the velocity and the air mass flow against time. For that i wrote the following command which gave me the corresponding plots:
plot(Measurement.(Measurement.air_mass_flow.time),Measurement.air_mass_flow.value)
plot(Measurement.(Measurement.velocity.time),Measurement.velocity.value)
Now i Need to create a script in matlab wherein i can get both the curves one under the other i.e. on the same page. Can anyone help in the Approach i should procede with ?
ok now i will further extend my question.
I have two fields as velocity and acceleration. I Need to plot it on the same curve with grids on for the comparison. But the y axis for both are different.
the velocity y-axis is: (0:20:120), which should be displayed on the left side and the acceleration y-axis is: (0:2:12) which should be displayed on the right side.
i wrote the following code for this:
plot(Measurement.(Measurement.VehV_v.time),Measurement.VehV_v.value)
grid on
set(gca,'xtick',[0:500:2000])
set(gca,'ytick',[0:20:120])
hold on
plot(Measurement.(Measurement.accel_w.time),Measurement.accel_w.value)
grid on
set(gca,'xtick',[0:500:2000])
set(gca,'ytick',[0:2:12])
Do i Need to write a function for that as i am directly reading the values from the structure.
plotyy() also doesnt seem to work
But the axis are not matching and the graph for acceleration is very small. Could anyone help me out with this ?
I also want to add a Picture of the Graphs here but unfortunately there is some error here. I hope the question is clear without the Picture.
Yes you can use the subplot command, e.g.:
figure
subplot(1,2,1)
plot(Measurement(Measurement.air_mass_flow.time),Measurement.air_mass_flow.value)
subplot(1,2,2)
plot(Measurement.(Measurement.velocity.time),Measurement.velocity.value)
You can use help subplot on Matlab for further details or have a look at this:
https://www.dartmouth.edu/~rc/classes/matlab_graphics/Matlab-subplots.html

How can I display different images on different axes in the same GUI in MATLAB?

I'm using MATLAB R2012a to develop a GUI for manual medical image segmentation. In particular, I want this regions to train a classifier for automatic brain tissue classification.
The GUI I design contains 2 axes, with tags 'figureImage' and 'figureVOI', respectively. In the first one I want to display a single slice of a 3D MRI scan, and in the other one I want to show the mask associated to that slice. I allow the user to move between slices using a scroll bar.
I'm using a 3D matrix to represent the image ('image'), and a 3D matrix to represent the mask ('voi'), both of them in the handles structure. I initialize the 'voi' matrix with zeros when the GUI is loaded.
The code I applied when the user clics on the scroll bar is the next:
% update the number of the actual slice
handles.actualSlice = round(get(handles.sliceSelector, 'Value'));
% update the image and the mask
axes(handles.figureImage)
imshow(handles.image(:, :, handles.actualSlice));
axes(handles.figureVOI)
imshow(handles.voi(:, :, handles.actualSlice));
However, when I clic on the scroll bar, the GUI just scroll to cut nÂș 70 aprox., and then all then the GUI stops to update the axes. If I close the window and try to run the GUI again, and MATLAB shows me a system error.
I want to know what I'm doing bad, and if there is another way to do what I need to do. Thanks a lot! :)
This is fairly easy question. You may have have different axis names and axes positioned at different locations.Then you route your images to the respective axes depending on which ever you want to choose to work with as the axes and you can choose both at the same time. Hope this helps. Good luck.