How to scale the length of the x-axis/graph?
Show older comments
Hey,
I am plotting several 2D-profiles one after another with the same Matlab-script by just changing the input files. The x-axis displays the profile meter, e.g. goes from 0m to 100m and the y-axis the depth. I want to scale the x-axis in such way that 10m in both plots are the same (e.g. if you want so 1cm).
Is that possible? So I want to use the xlim for scaling, but how?
More info:
- I save the pictures as .eps if that makes a difference...
- Matlab 2015b
Edit: I added a picture

Accepted Answer
More Answers (3)
John BG
on 15 Dec 2015
or:
ax=gca
ax.XLim
or:
axis([xmin xmax ymin ymax])
or:
xlim([0 100])
to prevent limits changing:
xlim manual
or:
axis manual
whatever changes, to reset:
axis normal
Steven Lord
on 15 Dec 2015
0 votes
If I understand what you're trying to do, you want the two axes to have the same limits (if they're the same size, you will need to do this to keep the lengths in sync.) If so take a look at LINKAXES.
Categories
Find more on Exploration and Visualization 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!