Clear Filters
Clear Filters

How can I move a plot to the left?

18 views (last 30 days)
j_solar
j_solar on 16 Jan 2013
Commented: Walter Roberson on 22 May 2020
When doing plotyy the right axis label is outside the image and there is some space left on the left of the left axis. I would like to move the whole plot left so that both axis labels fit correctly. Is it possible with Matlab code?
ty

Accepted Answer

Thorsten
Thorsten on 16 Jan 2013
Edited: Thorsten on 16 Jan 2013
pos = get(gca, 'Position');
xoffset = -0.1;
pos(1) = pos(1) + xoffset;
set(gca, 'Position', pos)
  2 Comments
Elena
Elena on 22 May 2020
It it possible to make this to work also to move up an entire plot?
Thank you.
Walter Roberson
Walter Roberson on 22 May 2020
add a positive value to pos(2)

Sign in to comment.

More Answers (0)

Categories

Find more on Two y-axis 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!