How to put a constant multiple along y-axis in the plot window?

8 views (last 30 days)
I want to plot a 2D graph with two-vectors which I do like this:
plot(x,y)
However, in the plot window, I want the y-axis to be shown to be multiplied by a constant factor e.g. 1000. So, it just plots x versus y but at the top of y-axis, puts a text "x 1000".

Answers (2)

Azzi Abdelmalek
Azzi Abdelmalek on 13 Nov 2013
Edited: Azzi Abdelmalek on 13 Nov 2013
%Example
t=0:0.1:10;
y=sin(t);
plot(t,y)
cst=1000
old_Yticks=get(gca,'ytick')
new_Yticklabel=arrayfun(@num2str,old_Yticks*cst,'un',0);
set(gca,'yticklabel',new_Yticklabel)

Muhammad
Muhammad on 13 Nov 2013
I don't want the y-axis to be changed but just the whole axis is shown to be multipled with 1000 at the end of axis label.

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!