How to put a multiple on the y-axis top in plot figure?

2 views (last 30 days)
I am plotting two vectors using the command plot(x,y). However, I want to have a constant multiple to be put at the top of axis in the plot figure.
For example, I need to plot values of y along y-axis. If y = [1000 2000 3000 4000 5000] and y' = [1 2 3 4 5], I use the command plot(x,y'). Then in the plot figure, I want to put a small text at top of axis saying 10^3.
Remember, I don't want to multiply the y-axis with 10^3 but to put just a text at top of the axis.
  2 Comments
Muhammad
Muhammad on 14 Nov 2013
Yes if the number is very big then MATLAB does it. But if the numbers are very small, how could you do this manually?

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 14 Nov 2013
MATLAB will do this automatically for large or small values, but there is no documented method of turning on the behavior automatically. Therefore you will need to text() the multiple into place, and adjust the ylabels property of the axis to have the strings you want to use.

Tags

Community Treasure Hunt

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

Start Hunting!