On Wednesday, May 20, 2015, Max Katz <maxpkatz(a)gmail.com> wrote:
Just want to add that this functionality is something
I recently found a
need for. Is it perhaps possible to generate the camera object first,
rotate it, and then take a slice?
We were talking about slices and projections earlier in this thread, there
is no camera in those cases. The problem there is that the plot layouts are
hard-coded to some degree and someone would need to generalize the layout
logic to handle horizontal colorbars. It's not *too* complicated, but care
needs to be taken to ensure plots look good in as many cases as possible.
As with most improvements we want to make, we're limited by contributor
Just in case you're interested in hacking on yt internals, the layout code
in question is here:
This is called when we set up each individual plot in one of the image plot
containers defined in yt/visualization/plot_window.py.
Axis-aligned slices and projections need to be locked to the coordinate
axes, but off-axis slices and projections as well as volume
renderings allow arbitrary rotation of the image plane. This works right
While it would be nice if yt's plotting code could make "nice" plots out
the box for any kind of data thrown at it, that is not the case right now.
That's one of the reasons why we expose everything you need to make a
custom plot based on the image buffers returned by a FixedResolutionBuffer
Ph.D. Candidate, Department of Physics and Astronomy
Vice President, Graduate Student Organization
Stony Brook University
On Mon, May 18, 2015 at 11:37 AM, Nathan Goldbaum <nathan12343(a)gmail.com
On Monday, May 18, 2015, Jason Galyardt <jason.galyardt(a)gmail.com
Is there a convenient way to rotate a slice or projection plot (with
associated axis labels and tick marks) in yt? My simulation domain is long
and skinny, and yt automatically plots it with the long edge aligned
horizontally; I'd like to rotate these 2D plots by 90 degrees.
I've wanted to add the ability to select the color at orientation for a
while now, but right now the colorbar os assumed to be vertical.
I've combed through the docs and the only way I can think to do it would
be to create a fixed resolution buffer and then manipulate it via
matplotlib functions. The camera seems only applicable for 3D (and doesn't
paint the axes, so far as I can tell).
This is likely the easiest way to do it right now.
Any ideas or pointers to docs?
Department of Physics and Astronomy
University of Georgia
yt-users mailing list
yt-users mailing list