Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Can a uicontrol contain a plot?
Date: Mon, 20 Aug 2007 03:26:08 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 46
Message-ID: <fab1kg$5l1$1@fred.mathworks.com>
References: <faam18$str$1@fred.mathworks.com> <fab09o$f8e$1@canopus.cc.umanitoba.ca>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1187580368 5793 172.30.248.38 (20 Aug 2007 03:26:08 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 20 Aug 2007 03:26:08 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1030060
Xref: news.mathworks.com comp.soft-sys.matlab:424531



Thanks for both the suggestions. 

I think I'll try adding a ButtonDownFcn to a subplot. If
that doesn't fit my needs, I'll try the creative CData
suggestion. Thanks!

roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
message <fab09o$f8e$1@canopus.cc.umanitoba.ca>...
> In article <faam18$str$1@fred.mathworks.com>, G.A.M. 
<x0zero@gmail.com> wrote:
> 
> >Can I display a plot in a uicontrol (a push button)?
> 
> >If so, maybe I can add N uicontrols on a panel and display a
> >plot on each uicontrol and assign a function to
> >ButtonDownFcn that will grab some values from the plot's
> >UserData and generate a new full sized plot (with more
details).
> 
> uicontrols cannot, as you have indicated you learned, have
axes
> as children.
> 
> However, there is a sense in which a uicontrol could
> display a plot: pushbuttons and togglebuttons can have a CData
> property,
> 
>     Truecolor image displayed on control. A
three-dimensional matrix of
>     RGB values that defines a truecolor image displayed on
a control,
>     which must be a push button or toggle button. Each
value must be
>     between 0.0 and 1.0.
> 
> So if you were to render the plot offscreen, then use the
rendered
> image as your CData, then the button would appear to have a
> (static!) plot.
> 
> I am not recommending this method; it just would not be quite
> right to say that uicontrols -cannot- have "plots".
> -- 
>    I was very young in those days, but I was also rather dim.
>    -- Christopher Priest