Thread Subject: Different types of plots in the same uipanel

Subject: Different types of plots in the same uipanel

From: William

Date: 31 Oct, 2008 04:23:01

Message: 1 of 3

Hi,

I am going between a single plot and multiple subplots plots in the same uipanel of a GUI I am creating. A value in a popupmenu determines the type of plot to graph. I've created the GUI using 'guide' and I have placed an axes in the desired uipanel.

The problem is, when I switch between the single plot and the subplots, it seems that I am clobbering my axes object. If I display all of the handles in the command window, the axes handle is displayed until I select to option to plot the subplots. If I go back to the single plot, I receive an error that says 'Invalid Handle Object' and the axes handle disappears from the list of handles.

Does the function subplot clobber the current axes object? Does anyone know why my axes handle is disappearing when the function subplot is called?

Thanks for your help!

Bill King

Subject: Different types of plots in the same uipanel

From: Walter Roberson

Date: 31 Oct, 2008 06:46:46

Message: 2 of 3

William wrote:

> Does the function subplot clobber the current axes object?

Yes, just as it is documented to do.

>> help subplot

    If a SUBPLOT specification causes a new axis to overlap an
    existing axis, the existing axis is deleted - unless the position
    of the new and existing axis are identical. For example,
    the statement SUBPLOT(1,2,1) deletes all existing axes overlapping
    the left side of the Figure window and creates a new axis on that
    side - unless there is an axes there with a position that exactly
    matches the position of the new axes (and 'replace' was not specified),
    in which case all other overlapping axes will be deleted and the
    matching axes will become the current axes.



--
.signature note: I am now avoiding replying to unclear or ambiguous postings.
Please review questions before posting them. Be specific. Use examples of what you mean,
of what you don't mean. Specify boundary conditions, and data classes and value
relationships -- what if we scrambled your data or used -Inf, NaN, or complex(rand,rand)?

Subject: Different types of plots in the same uipanel

From: William

Date: 3 Nov, 2008 06:03:02

Message: 3 of 3

Hi Walter,

Thank you for the reply! The function subplot seems to be getting in the way with what I am looking to do. Is there a better way of doing this? I could possibly create two different axes over one another. If I wanted to plot the single bar plot, I could display it on axes1 and make axes2 invisible. If I wanted to plot multiple pdf plots, I could call subplot and display it on axes2 and make axes1 invisible.

This seems problematic, because when I call subplot, it is still going to erase axes2, correct? Is there a way to do this so I don't loose my axes and can reuse it over and over with each different type of plot?

Thanks for your help!!

V/R
Bill King

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
bar William 3 Nov, 2008 01:05:07
clobber William 31 Oct, 2008 00:25:05
subplot William 31 Oct, 2008 00:25:05
plot William 31 Oct, 2008 00:25:04
gui William 31 Oct, 2008 00:25:04
handles William 31 Oct, 2008 00:25:04
axes William 31 Oct, 2008 00:25:04
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com