postgkyl.plotly

postgkyl.plotly(data, *, squeeze=False, num_subplot_row=None, num_subplot_col=None, scatter=False, marker_radius=4.0, markerstyle='circle', diverging=False, xscale=1.0, xshift=0.0, yscale=1.0, yshift=0.0, zscale=1.0, zshift=0.0, cmin=None, cmax=None, cscale=1.0, cshift=0.0, clim=None, style=None, rcParams=None, background='dark', invert_cmap=False, no_legend=False, label_prefix='', no_colorbar=False, xlabel=None, ylabel=None, zlabel=None, clabel=None, title=None, logx=False, logy=False, logz=False, logc=False, aspect=None, no_showgrid=False, hashtag=False, xkcd=False, color=None, opacity=1.0, scatter_opacity_range=None, scatter_opacity_log=False, maximum_points_per_axis=0, surface_count=32, xrange=None, yrange=None, zrange=None, figsize=None, cylindrical_to_cartesian=False, cmap=None, save=False, saveas=None, show=False, azimuthal_angle=0.0, polar_angle=85.0, rotation_period=40.0, fps=1)

Render 2-D surface or 3-D volumetric data with Plotly.

2-D data (num_dims == 2, after squeezing any size-1 axis) is drawn as a go.Surface (height map); 3-D data is drawn as a go.Volume or, with scatter=True, a go.Scatter3d point cloud. Multi-component data lays out one scene per component unless squeeze is set.

save/saveas/show make this call self-sufficient without any CLI glue: show=True opens an auto-rotating HTML preview in the browser; saveas (or save=True for an auto-derived name from data’s source file) writes it instead – .mp4/.gif/.html extensions get the rotating camera baked in (via save_rotating_plotly_figure()), any other extension a plain static .html. If both a save and show=True are requested, the just-saved file is what opens (no separate preview render). All three default to inert (show=False, save=False) – a bare pg.load(f).interpolate().plotly() just builds and returns the figure, no file written and no browser opened; the generated CLI has exactly the same defaults.

Parameters:
  • data – Point-value dataset to render.

  • squeeze – Draw only the first component and collapse singleton axes.

  • num_subplot_row – Forced row count for multi-component subplot layouts.

  • num_subplot_col – Forced column count for multi-component subplot layouts.

  • scatter – Draw 3-D data as a point cloud instead of a volume.

  • marker_radius – Scatter-marker radius.

  • markerstyle – Plotly scatter-marker symbol.

  • diverging – Center a diverging color range on zero.

  • xscale – Horizontal-coordinate scale factor.

  • xshift – Horizontal-coordinate shift applied before scaling.

  • yscale – Vertical-coordinate scale factor.

  • yshift – Vertical-coordinate shift applied before scaling.

  • zscale – Third-coordinate scale, or 2-D surface-height scale.

  • zshift – Third-coordinate shift, or 2-D surface-height shift.

  • cmin – Color-range lower bound.

  • cmax – Color-range upper bound.

  • cscale – Color-value scale factor.

  • cshift – Color-value shift.

  • clim – Explicit (minimum, maximum) color range.

  • style – Postgkyl/Matplotlib style used to derive colors.

  • rcParams – Matplotlib configuration overrides used while deriving styles.

  • background – "dark" or "light" scene theme.

  • invert_cmap – Reverse the selected colormap.

  • no_legend – Suppress labeled traces in the legend.

  • label_prefix – Prefix for component trace names.

  • no_colorbar – Suppress the color bar.

  • xlabel – Horizontal-axis label override.

  • ylabel – Vertical-axis label override.

  • zlabel – Third-axis label override.

  • clabel – Color-bar label override.

  • title – Figure-title override.

  • logx – Use a logarithmic horizontal axis.

  • logy – Use a logarithmic vertical axis.

  • logz – Use a logarithmic third axis.

  • logc – Use logarithmic color values.

  • aspect – Scene aspect mode (auto, cube, data), or numeric ratio.

  • no_showgrid – Suppress scene grid lines.

  • hashtag – Add a #pgkyl annotation.

  • xkcd – Derive colors from Matplotlib’s XKCD style.

  • color – Replace the colormap with one fixed trace color.

  • opacity – Surface, volume, or marker opacity.

  • scatter_opacity_range – Minimum and maximum opacity encoded in scatter colors.

  • scatter_opacity_log – Map scatter opacity logarithmically.

  • maximum_points_per_axis – Downsample 3-D data to this many points per axis; zero disables downsampling.

  • surface_count – Number of isosurfaces used by volume rendering.

  • xrange – Explicit horizontal-axis range.

  • yrange – Explicit vertical-axis range.

  • zrange – Explicit third-axis range.

  • figsize – Figure width and height in hundreds of pixels.

  • cylindrical_to_cartesian – Interpret 3-D coordinates as (R, Z, phi).

  • cmap – Matplotlib colormap name.

  • save – Save using a name derived from the input dataset.

  • saveas – Explicit output path.

  • show – Open the saved or temporary HTML preview in a browser.

  • azimuthal_angle – Initial camera azimuth for rotating output.

  • polar_angle – Camera polar angle for rotating output.

  • rotation_period – Seconds per camera revolution for animated output.

  • fps – Frames per second for animated output.

Returns:

the assembled figure.

Return type:

plotly.graph_objects.Figure

CLI: plotly