Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Change xlabel of subplot with already stored figure
Replies: 8   Last Post: Sep 12, 2013 5:59 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
dpb

Posts: 8,182
Registered: 6/7/07
Re: Change xlabel of subplot with already stored figure
Posted: Sep 11, 2013 8:29 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 9/11/2013 6:22 PM, Sankalp Dayal wrote:

Do NOT toppost... :(

> I tried the exactly the same thing that was suggested but still it
> doenst work. I have uploaded the files here


> The one that doesnt work
> https://docs.google.com/file/d/0B5jOXNF7SvrgbVVESFp0ZXYzeFk/edit?usp=sharing
>
> The one that work
> https://docs.google.com/file/d/0B5jOXNF7SvrgNTZ5ZkFzdlBwcjQ/edit?usp=sharing
>

...

Hmmm....same symptoms here, indeed. I can only conjecture something's
different in the way the two were manipulated prior to saving -- like
the positions of the axes were modified just enough to cause a floating
point mismatch in the size comparison inside subplot() when it opens the
one that thinks it's not the same position as the first.

I see two workarounds --

a) Find out what actually is causing the above symptom -- I'd start by
using the default positions for subplot() and make the one that fails
again and look at the position vector there and compare that to that of
the saved version... or,

b) Load the figures and then use the handles to the axes objects
directly -- I think it will depend on how they were created as to the
order but in the one that failed the two plot axes object handles are
the 2nd and 4th and the legends are the 1st and 3rd...

hfig=hgload('fig1.fig');
hax=get(hfig,'children');
xlabel(hax(2),'new label 1')
xlabel(hax(4),'other new label')

works as expected here while I do see the problem you outline on the
subplot() open not recognizing the existing axis should seemingly match.

--





Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.