could anyone help me how to solve the issue
1 view (last 30 days)
Show older comments
I am getting the attached graph when i run the code.
In graph i want to remove zero with respect to y axis where as the rest of the values on y axis should remain same.
Could anyone please help me on this.
3 Comments
Shashank Sharma
on 4 Jul 2019
Do you want to change the y limits ?
If so the function ylim can be used.
ylim( [ ymin, ymax ] )
In the above function if you set the ymin to be greater than 0. The 0 will no longer be displayed on the plot
Accepted Answer
Rik
on 4 Jul 2019
Edited: Rik
on 4 Jul 2019
If you want to not show a tick, you can remove it by explicitly skipping it.
ylim([0,1.1])
set(gca,'YTick',[0.2:0.2:1.1])
You can also choose to automatically remove the first tick after plotting:
ylim([0,1.1])
ticks=get(gca,'YTick');
set(gca,'YTick',ticks(2:end))
3 Comments
More Answers (0)
See Also
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!