[yt-users] plotting just contours in a slice

Matthew Turk matthewturk at gmail.com
Fri May 24 10:54:24 PDT 2013


Hey Chris,

I think your best bet might be to do the full process -- create a
slice, annotate it with contours (maybe even filled contours, which
could be an option), and then access the matplotlib axes object.  On
the axes object there will be an attribute called images, or image,
which will contain all the matplotlib.image.AxesImage objects.  I
believe you can set the alpha on an AxesImage object to 0.0 using
set_alpha, which should de-blend it, but you may also be able to call
set_visible(False).

But I like this idea, and maybe we should make it easier to do.
Here's an example of getting at the axes objects:

http://yt-project.org/docs/2.5/cookbook/simple_plots.html#accessing-and-modifying-plots-directly

If this works for you, it'd probabyl be worth a quick recipe in the cookbook.

-Matt

On Fri, May 24, 2013 at 1:46 PM, Chris Malone <chris.m.malone at gmail.com> wrote:
> Hi all,
>
> I would like to be able to take a slice through a 3D dataset and then plot
> just the contours of a single variable within that slice.  I do not want to
> overlay the contours with an annotate_countours method.
>
> I know one way about this would be to use the FixedResolutionBuffer of some
> slice plot to reconstruct a mesh-grid and the data, which can then be used
> within matplotlib directly to create a contour plot.
>
> I was curious if there was a more clever method using yt plot objects?
>
> Chris
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>



More information about the yt-users mailing list