How to scale both axis on a plot

조회 수: 2 (최근 30일)
SEBASTIAN MASCHERONI MUSSINI
SEBASTIAN MASCHERONI MUSSINI 2019년 11월 4일
답변: Jyotsna Talluri 2019년 11월 7일
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.

답변 (1개)

Jyotsna Talluri
Jyotsna Talluri 2019년 11월 7일
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);

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by