Slicer plot#

The slicer plot is designed to provide sliders to slice higher dimensions of the data in an interactive way.

This is used for example in the case of having a 3 dimensional data cube, and wanting to display it as a 2 dimensional image, with a slider to navigate the third dimension.

[1]:
%matplotlib widget
import plopp as pp

da = pp.data.data3d()

The slicer function needs a list of dimensions that are to be kept (all remaining dims will be sliced):

[2]:
pp.slicer(da, keep=['x', 'y'])
[2]:

Keeping only a single dimension will produce a 1 dimensional plot:

[3]:
pp.slicer(da, keep=['x'])
[3]:

Animate the sliders#

f0da6b10a20a461693d6f468e46e03af   New in version 25.07.0.

It is possible to display some animation controls (play button) next to the slider, by using the enable_player=True option:

[4]:
pp.slicer(da, keep=['x', 'y'], enable_player=True)
[4]:

Can I have a 3D plot with a slider?#

3D plots are not supported out of the box by the plopp.slicer function, but it is still possible to create them.

An example in the gallery shows you how to do this.