How to scale both axis on a plot

3 views (last 30 days)
SEBASTIAN MASCHERONI MUSSINI
Answered: Jyotsna Talluri on 7 Nov 2019
Hi all,
I need to scale both axis of one 2D graph for export it.
I am trying to plot force vs displacement (x), and I am asked to print the plot, following this scale:
1000 N should be 175mm
1m of displacement, should be 135mm
Any idea?
Thank you in advance.

Answers (1)

Jyotsna Talluri
Jyotsna Talluri on 7 Nov 2019
You can extract the XData and YData of the plot and then again set it by scaling.
h=plot(x,y);
xData=get(h,'XData')
yData=get(h,'YData')
set(h,'XData',xData*135);
set(h,'YData',yData*175/1000);

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!