How do I use matlab to plot a graph where the x,y axes do not intersect?
Show older comments
How can I use matlab to plot a graph where the x,y axes do not intersect? Similar to the image below, note that the bottom left corner does not cross.The x- and y-axes are shown with specified ranges

5 Comments
I don't know the smart solution, but you could generate an axis where you plot you dara but you hide y and x axis. before that you have to create two other axis, in one you hide the y axis in the other the x axis. these to axes have to be shifted in position compared to the plotting axis. then you can link the axes such that plotting in the axis with hidden x and y has an influence on the 'helper' axes
Adam Danz
on 27 Apr 2021
This will likely require a deep dive into undocumented methods. It will require making changes to the xruler and yruler, both of which are properties of axes.
xingxingcui
on 28 Apr 2021
xingxingcui
on 29 Apr 2021
Accepted Answer
More Answers (1)
Bob Thompson
on 27 Apr 2021
0 votes
Create your figure first, then create the axes. This will allow you to specify what they are before the data gets populated, and should allow you to fix their positions.
I have not looked at the documentation in enough detail to confirm it will do exactly what you want, but it should be in the axes command.
2 Comments
xingxingcui
on 28 Apr 2021
Adam Danz
on 28 Apr 2021
cui is correct here. There are no axes properties that can achive this. There are, however, undocumented ruler properties that can achieve at least some of it.
Categories
Find more on Graphics Performance 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!