[ncl-talk] duplicating a graphic plot, and disassociate from original.

Alan Brammer abrammer at albany.edu
Thu Oct 9 17:25:58 MDT 2014


Mary, No worries, the work you (and all of the rest) do on here is
fantastic. I can wait a few days.

Ah ok.  Thought that would be the situation.  The reason I ask is I wanted
to break the y axis on a plot, and if you want an example I can provide one
with code.  Worked out a way to do it, and then made it into a function.
At the moment though I have to pass 2 versions of the plot to the
function.  Which is fine, just not as elegant as I wanted.

Thanks for your assistance.

~Alan


On Thu, Oct 9, 2014 at 6:46 PM, David Brown <dbrown at ucar.edu> wrote:

> No I don't think there is any means of copying a plot object
> currently. Note that a copy would need to make copies of each of the
> building block objects that a plot object is composed of; e.g. new
> text objects for each piece of text. I am not sure that it would be
> much more efficient than just creating a new plot object as per your
> workaround.
>  -dave
>
> On Thu, Oct 9, 2014 at 4:23 PM, Mary Haley <haley at ucar.edu> wrote:
> > Alan,
> >
> > Sorry about the delay in response.  I've been out of the office a lot.
> >
> > As far as I know, there is no way to make a copy of a plot without
> calling
> > the function again.
> >
> > When you do something like this:
> >
> >   plot_a = plot
> >   plot_b = plot
> >
> > You are effectively pointing plot_a and plot_b to the same plot, so any
> > changes to any one of these is changing all of them, because they are the
> > same plot.
> >
> > Dave Brown may know if we have an internal function that allows you to
> copy
> > a plot object without having to generate it from scratch.
> >
> > --Mary
> >
> >
> > On Fri, Oct 3, 2014 at 12:17 PM, Alan Brammer <abrammer at albany.edu>
> wrote:
> >>
> >> I came across an instance where I want to take a plot, duplicate it,
> >> change some settings in each of the new plot and draw both new plots.
> >>
> >> However all changes to duplicated objects change all the other objects.
> >> I'm not sure of the proper terminology so made a simple example attached
> >> below
> >>
> >> I make one plot, copy it, change the titles on the 2 new plots. Now all
> 3
> >> plots have the same title as the last one changed.  And if I try and
> panel
> >> the 3 plots, it gets confused as I guess they're all really just one
> plot
> >> with 3 different pointers.
> >>
> >> Is there a way to duplicate the plot not just create a new pointer to
> it.
> >> (without just running the plot line again, which is my current work
> >> around.).
> >>
> >>
> >>
> >> Thanks,
> >> Alan.
> >>
> >> _______________________________________________
> >> ncl-talk mailing list
> >> List instructions, subscriber options, unsubscribe:
> >> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >>
> >
> >
> > _______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141009/59474599/attachment.html 


More information about the ncl-talk mailing list