Be notified of new releases
Create your free GitHub account today to subscribe to this repository for new releases and build software alongside 28 million developers.Sign up
Add an interactive slicer for 3D volumes. At the moment only implemented for tensor meshes.
- Mouse wheel scroll while hovering over a subplot scrolls through the third axis (e.g., hovering over the xy-slice and scrolling your mouse wheel will go through the z-axis).
- The three subplots are synced, also for zooming and moving.
- The initial slices can be provided via the
zsliceparameters (default is in the middle of the volume).
- Transparency values and ranges can be provided (a list of floats and tuples/lists of two values), e.g. to hide the seawater or to focus on an interesting part, e.g.,
[0.3, [1, 4], [-np.infty, -10]]to remove all values equal to 0.3, all values between 1 and 4, and all values smaller than -10. For interactive range selection set
pcolorOptsas other mesh-plotting functions, which will be passed to
- By default the horizontal axis is
x, and the vertical axis is
y; this can be flipped by setting
By default, the aspect ratio of the three subplots is set to
'auto'. You can change this with the
parameter, however, expect the unexpected by doing this. Most importantly, the three subplots won't be nicely aligned, and zooming might result in funny arrangements. Two parameters can be used in this respect:
num. A list of two of them can be provided, in which case the first element is for the xy-slice, and the second element for the xz- and zy-slices. E.g.,
aspect=['equal', 2]sets the xy-slice to
equal, and in the other two the vertical dimension is exaggerated by a factor of 2.
plot_3d_sliceris on a
subplot2grid-grid, by default on a 3x3 grid, where 2x2 are used for the xy-slice, 2x1 for the xz-slice, and 1x2 for the zy-slice. You can provide a list of three integers via the
grid-parameter, which stand for the number of grid-units occupied for the x-, y-, and z-dimension (default is
[2, 2, 1]).
%matplotlib notebook in Jupyter. In regular IPython shells it should just work.