[yt-dev] Profile Plotting

John ZuHone jzuhone at gmail.com
Tue Dec 4 17:08:02 PST 2012


I'm very much with Nathan on this one.

John 

On Dec 4, 2012, at 7:47 PM, Nathan Goldbaum <nathan12343 at gmail.com> wrote:

> Hi Matt,
> 
> I'm personally not a fan of the level of abstraction necessary to produce an MPL object and save it to disk (i.e. in the notebook linked in the YTEP: http://nbviewer.ipython.org/url/hub.yt-project.org/notebooks/8df3719ddfd248ce9a3f10ca38a4ad57.ipynb)
> 
> One of the things I like about the plot window is that it's completely separate from the generation of the actual image buffers and depends on the FixedResolutionBuffer to do all the nasty work of touching the grids, pixelizing, and dealing with the real-world nature of the actual data.
> 
> It would be nice if we had a similar situation on the profile/phase plot side of things.  We could use ProfilePlotter and PhasePlotter to generate the raw histogram data and then use something similar to the PlotWindow to generate the plots, save them to disk or display them in iPython notebooks.
> 
> I guess I'm proposing another level of abstraction:
> 
> pf = load(filename)
> dd = pf.h.all_data()
> pha = PhasePlot(dd, 'Density', 'Temperature')
> 
> One could then access the MPL Figure object via something similar to PlotWindow:
> 
> fig = pha.Figure
> 
> and it would be just as easy to save the figure to disk:
> 
> pha.save()
> 
> I'll confess that I haven't looked at PhasePlotter or ProfilePlotter too carefully so it might be easier to just change them to match this API.  I also don't make profile plots very often so someone who uses them all the time should probably have more weight in this discussion.
> 
> Cheers,
> 
> Nathan
> 
> On Dec 4, 2012, at 1:21 PM, Matthew Turk wrote:
> 
>> Hi everyone,
>> 
>> I've put in a YTEP, which has been built here:
>> 
>> https://yt.readthedocs.org/projects/ytep/en/latest/YTEPs/YTEP-0002.html
>> 
>> Before it goes forward I'd like to hear feedback on what it describes
>> and proposes, and then I will continue with implementing and shoring
>> things up.  In particular, hearing how it could be made to provide as
>> seamless an experience as the PlotWindow would be nice.
>> 
>> -Matt
>> 
>> On Mon, Dec 3, 2012 at 2:03 PM, Matthew Turk <matthewturk at gmail.com> wrote:
>>> On Mon, Dec 3, 2012 at 2:02 PM, Matthew Turk <matthewturk at gmail.com> wrote:
>>>> Hi all,
>>>> 
>>>> As I noted in my other email, there was one major feature we'd talked
>>>> about for yt 2.5 that we never even really worked on.  Nathan and
>>>> others pushed really hard on rethinking and redesigning the way image
>>>> plots were made and handled back in the 2.4 series, which eliminated
>>>> the main use case for the PlotCollection.  However, the remaining
>>>> firewalls on PlotCollection are the 1-D and 2-D phase plots.
>>>> 
>>>> There's been broad consensus that we need a new method for doing this,
>>>> analogous to how PlotWindow serves to replace "add_slice" and
>>>> "add_projection" from the PlotCollection.  Something that gets out of
>>>> the way and lets people modify their plots as they see fit.
>>>> 
>>>> A while back I implemented a first pass at this, which you can see in
>>>> yt/visualization/profile_plotter.py:
>>>> 
>>>> https://bitbucket.org/yt_analysis/yt/src/711e95aff04b54e6ccda7dfefb0b0ae17c3830a7/yt/visualization/profile_plotter.py?at=yt
>>>> 
>>>> The idea here is that you create an instance of ProfilePlotter or
>>>> PhasePlotter, which then "Does the right thing" and creates the
>>>> necessary data objects and the like.  This object can then either
>>>> create its own axes+figure in matplotlib, or it can deposit itself
>>>> into an existing axes object.  It includes axis objects and plot
>>>> containers that know how to plot themselves.
>>>> 
>>>> I don't know that I necessarily like how this is done.  It's very
>>>> declarative, and step by step, but I think it could be easier.  Here's
>>>> an example:
>>>> 
>>>> https://hub.yt-project.org/go/vlilvw
>>> 
>>> That should read:
>>> 
>>> https://hub.yt-project.org/nb/vlilvw
>>> 
>>>> 
>>>> One thing I think *is* quite nice is that the *plot* object is
>>>> independent of the profile itself.  This makes it easier to pickle and
>>>> unpickle things, and is the reason for the existence of the various
>>>> sub-objects off of ProfilePlotter.  This is useful for the use case of
>>>> making very large datasets into profiles, pickling the resulting
>>>> plots, and modifying them later.
>>>> 
>>>> So here are my specific questions:
>>>> 
>>>> * Does this rough outline of how the object works seem good?  As in,
>>>> making a plotter object, making it have a sub .plot object, and then
>>>> dispatching that plot object to various backends?  (Probably nearly
>>>> always matplotlib.)
>>>> * Should we add on additional convenience operations?
>>>> * How should it interface with existing profiles?
>>>> * Should implementing this and finalizing the design be a blocker for 2.5?
>>>> 
>>>> I will create and update a YTEP with the resulting discussion from
>>>> this.  Nathan, Jeff and Britton -- I would very much appreciate your
>>>> feedback, as I know you have experience with (respectively) plot
>>>> windows, matplotlib, and large datasets being profiled.
>>>> 
>>>> -Matt
>> _______________________________________________
>> yt-dev mailing list
>> yt-dev at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
> 
> _______________________________________________
> yt-dev mailing list
> yt-dev at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-dev-spacepope.org/attachments/20121204/b904f514/attachment.html>


More information about the yt-dev mailing list