Plot.i want my Y axis...
5 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (2 件)
Mark Mikofski
2013 年 1 月 2 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Interactive Control and Callbacks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!