Plot.i want my Y axis...
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I plot a graph.its y axis is between -0.5 and 0.5. But i want it between -1 and 1.like this -1 , -0.8 , -0.6 , -0.4 , -0.2 , 0 , 0.2 , 0.4 , 0.6 , 0.8 , 1. Thank you in advance
0 Kommentare
Antworten (2)
Mark Mikofski
am 2 Jan. 2013
ylim([YMIN, YMAX])
or in your case
ylim([-1, 1])
then to set the tick marks use the set and get methods for the current axis. See help on gca, axes and axes properties:
plot(x,y); % assuming you have some data to plot called X and Y
set(gca, 'YTick', [-1:0.2:1], 'YLim', [-1, 1]) % set the y-axis limits too
gca is a handle to the current axes. You may need to click on the plot in the figure you want to edit.
You can also use MATLAB's gui Plot Tools by clicking on the "Show Plot Tools and Dock Figure" button on the toolbar, usually the last one on the right. You could also access this from the menu bar: Edit > Axes Properties..., which does the same thing. Then select the Y Axis tab and set teh limits and click the Ticks button to set the ticks.
Explore the figure and use the help docs, and you will find many ways to achiev your goal. Good luck!
0 Kommentare
Siehe auch
Kategorien
Mehr zu Interactive Control and Callbacks finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!