Thread Subject: Plots dissapear when using "axes"

Subject: Plots dissapear when using "axes"

From: Volker Klink

Date: 10 Nov, 2009 09:42:04

Message: 1 of 3

Hi everyone!

I have a really odd behaviour of "axes".

I plotted 2 graphs using "plotyy".

[handles.AX1,handles.H1,handles.H2] = plotyy( handles.Signal1TimeVector,...
                                                handles.Signal1,...
                                                handles.Signal2TimeVector,...
                                                handles.Signal2);

handles.AX1 contains the two handles of the axis.

Whenever I call "axes(handles.AX1(n))", one of the graphs keeps dissapearing!!!

Iuse Matlab 2006b.

anyone has an idea?
Thanks
Volker

Subject: Plots dissapear when using "axes"

From: Jan Simon

Date: 10 Nov, 2009 10:44:02

Message: 2 of 3

Dear Volker!

> I plotted 2 graphs using "plotyy".
>
> [handles.AX1,handles.H1,handles.H2] = plotyy( handles.Signal1TimeVector,...
> handles.Signal1,...
> handles.Signal2TimeVector,...
> handles.Signal2);
>
> handles.AX1 contains the two handles of the axis.
>
> Whenever I call "axes(handles.AX1(n))", one of the graphs keeps dissapearing!!!

In Matlab 6.5 the 2nd axis vanishes for "axes(handles.AX1(1))", but for "axes(handles.AX1(2))" both axes are visible. This is exactly what I would expect after inspecting the source of PLOTYY, because this draws the first axis with a white opaque background, while the 2nd axes uses the "Color" 'none'.

Solutions:
1. Either set the "Color" of the 1st axes object to 'none' also.
2. Or even better: do not call "axes(handles.AX1(1))"! If you want to add further objects in the 1st axes, set the according property, e.g.:
  line(1:10, 1:10, 'Parent', handles.AX1(1));
3. If you need a background color, which differs from the fugure's background, you have to create a further axes on the bottom of the others.

Good luck, Jan
Good luck, Jan

Subject: Plots dissapear when using "axes"

From: Volker Klink

Date: 11 Nov, 2009 10:13:04

Message: 3 of 3

Hi Jan!

Thanks for your reply! Still, this drives me crazy!!!!

> In Matlab 6.5 the 2nd axis vanishes for "axes(handles.AX1(1))", but for "axes(handles.AX1(2))" both axes are visible. This is exactly what I would expect after inspecting the source of PLOTYY, because this draws the first axis with a white opaque background, while the 2nd axes uses the "Color" 'none'.
> 2. Or even better: do not call "axes(handles.AX1(1))"! If you want to add further objects in the 1st axes, set the according property, e.g.:
> line(1:10, 1:10, 'Parent', handles.AX1(1));
 I was wondering how I could plot the graphs myself but now I'm slightly confused about the axes.

I want to plot both graphs in an already existing GUI-axes called axes_Signal12.

Any hints?

Thanks
Volker

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
dissapear Volker Klink 10 Nov, 2009 04:44:03
axes Volker Klink 10 Nov, 2009 04:44:03
plotyy Volker Klink 10 Nov, 2009 04:44:02
rssFeed for this Thread

Contact us at files@mathworks.com