[yt-users] Overplotting lines and points onto slices and projections

Setton, David Jonathan - (davidsetton) davidsetton at email.arizona.edu
Mon Jun 19 16:48:25 PDT 2017


Hi all,


I'm a relatively new user to yt, and I've been trying to figure out the best way to overplot some curves onto images generated by OffAxisProjectionPlot and OffAxisSlicePlot routines. My searching through the cookbooks has pointed me towards this page, which seems to indicate that accessing the matplotlib axes and figures are the right way to go about this. Following the example, I've created a density slice plot of my dataset and loaded in my plot in the following way:


dens_plot = slice.plots['density']

figure = dens_plot.figure
axes = dens_plot.axes
colorbar_axes = dens_plot.cax


>From here, my next step would be to plot the line I wish to plot using axes.plot(). However, running slice.show() after doing this just shows the original plot and does not contain the plot I've attempted to overplot. I'm sure my misunderstanding comes from not being familiar with how matplotlib works under the hood, but does anybody have any suggestions for the best way to go about doing this? I would also like to plot individual points on a projection plot in the xy-plane at some point, which I would assume has a very similar method.


Best,


David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20170619/2a015fc0/attachment.htm>


More information about the yt-users mailing list