How do I change the yaxis exponent when using a double y-axis plot?
139 views (last 30 days)
When use a plot with a y-axis on the left and a y-axis on the right, I can't figure out how to change the exponent of one y-axis. For example, when using the following code:
x = [1 2 3];
y1 = [2 6 4; 3 5 4; 5 7 8];
y2 = 100*[5 5 3; 3 4 7; 5 6 3];
ax = gca;
ax.YDir = 'reverse';
ax.YAxis.Exponent = 3;
So I can change the direction of the left axis, but when I change the exponent of the right axis, I get the following error: "Expected one output from a curly brace or dot indexing expression, but there were 2 results. Error in test line 19) ax.YAxis.Exponent = 3;"
Ramnarayan Krishnamurthy on 28 Dec 2017
Try setting the exponent as follows:
instead of ax.YAxis.Exponent = 3;
This sets the exponent of the second Y Axis (the one to the right) to 3.