This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
How do I edit the axes of an image in MATLAB to reverse the direction?
Hey guys,
In MatLab I have a pair of axes where the y-axis starts from (0,0) and counts up to (0,100) with tick marks on this x-axis going 0,1,2,...,100. Can a flip it so it goes 100,99,...,0 so the origin would be (0,100)? Any ideas? I know it's possible because I've seen graph figures like this.
set(gca,'YDir','reverse'); before you draw the graph. Thanks to gary comtois's link - stackoverflow.com/questions/2865600/
Related
This question already has an answer here:
How to hide the lines of a graph in MATLAB so that they do not extend beyond the frame
(1 answer)
Closed 1 year ago.
As you can see in the attached image, the line of the graph hangs over the axis, how can I make it not hang over the axis?
A simple approach could be to call something like
ylim([min(y(:))-0.02*range(y(:)) Inf]);
after plotting your data y. The 2% margin may be adjusted to your tastes.
This question already has answers here:
Plot circles with alpha values in MATLAB
(5 answers)
Closed 8 years ago.
I have a plot similar to the one below. This is a cylindar. The points near the axis are red and become more and more blue when they get far from it.
The problem is that the blue points completely hide the red ones.
Is there any way to make these blue points transparent enough to see what's inside?
I could suggest a hack to try. Given that you approximately know what the colors of the points you want to remove are, you could use findall or findobj to extract the line objects from your plots (maybe they're named something else in a 3D plot, don't have a lot of experience there) and then just delete those with the blue coloration.
This question already has answers here:
Turning y axis upside down in MATLAB
(5 answers)
Closed 9 years ago.
i have a problem with y-axis when i get snapshot from camera,the y-axis start from 450 to 50 ... I want to start from the small number to big number and not vice versa ....could anyone help me to fix this problem.... Thank you
You can change the axis direction using the axis properties:
set(gca,'YDir','reverse') % starts at the top of the figure
set(gca,'YDir','normal') %starts at the bottom of the figure
This question already has an answer here:
Closed 10 years ago.
i have a plot with many cycles of curves all similar but yet different from each other. the objective is for me to find the mean curve from all this curves. i cannot say where is the beginning or final point from each curve, since each cycle is different.
all i have is an excel file with two columns, one with the x coordinates and the other with the y coordinates.
Any help with be appreciated! thank you very very much!
Try to draw plots of different colors. It will be better for perception.
As you still have this in excel you could just build ONE y coordinate vector (median value) and plot this one.
This question already has answers here:
Retrieving X and Y values from Matlab Plot
(4 answers)
Closed 9 years ago.
I'm developing a GUI in Matlab that presents a plot (in an axis object). When clicking on a point in the plot, the GUI will open some other plots for that data point.
I added an axis object to my figure and implement the WindowButtonDownFcn to get a button click. I can get the mouse position with
pos=get(hObject,'CurrentPoint');
but how do I convert it to values in my plot? (i.e. which x-value was clicked on)
thanks.
(I'd be happy to hear if there is some simpler way to do this, instead of writing my own GUI)
Try looking up the help on ginput and then set that to some variable. Then plot the points for the number of ginputs you've done.
A lot of it is explained here: http://www.mathworks.com/help/techdoc/ref/ginput.html