Class o2graph_plotter

class o2sclpy.o2graph_plotter

A plotting class for the o2graph script. This class is a child of the o2sclpy.plot_base class.

This class is not necessarily intended to be instantiated by the end user.

The function parameter o2scl must always be a ctypes DLL object which points to the libo2scl shared library (.so on linux and .dylib on OSX). The function parameter amp must always be a pointer to the o2scl_acol::acol_manager object.

bl_import(gltf_path: str = '', blender_cmd: str = '', o2sclpy_dir: str = '', cam_dist: float = 5.0, light_energy: float = 800, light_dist: float = 5.8, bg_color: str = '', cam_type: str = '', res=(0, 0), blend_file: str = '')

This command requires the Blender python package, bpy.

bl_six_mp4(n_frames: int, mp4_file: str, blender_cmd: str = '', o2sclpy_dir: str = '', vf: str = '', cam_dist: float = 5.0, light_energy: float = 800, light_dist: float = 5.8, bg_color: str = '', cam_type: str = '', res=(0, 0), blend_file: str = '')

This command requires the Blender python package, bpy and the installation of ffmpeg.

bl_yaw_mp4(n_frames: int, mp4_file: str, blender_cmd: str = '', o2sclpy_dir: str = '', vf: str = '', cam_dist: float = 5.0, light_energy: float = 800, light_dist: float = 5.8, bg_color: str = '', cam_type: str = '', res=(0, 0), blend_file: str = '')

This command requires Blender, the associated python package, bpy, and the installation of ffmpeg.

vf=’eq=contrast=1’)

cbar = 0

Colorbar object

commands(o2scl, amp, link, args)

Output the currently available commands.

create_camera_vecs()

Create vectors (pos,foc,nor,wid) from the user settings in yt_position, yt_focus, yt_north and yt_width. This function is used in yt_render to keep track of the camera properties. The output vectors are always created in the internal coordinate system.

den_plot_anim(o2scl, amp, link, args)

Documentation for o2graph command den-plot-anim:

Create an animated density plot from a rank 3 tensor_grid object

Command-line arguments: <x index> <y index> <z index [+'r']> <mp4 filename> [kwargs for imshow()]

Create an mp4 animation of a density plot from a tensor_grid object with rank 3. The first argument specifies which tensor index is along the x axis (either 0, 1 or 2), the second argument is the tensor index is along the y axis (either 0, 1 or 2), and the third argument is the tensor index which will be animated. If the third argument has an additional r suffix, then the animation will be reversed, so that the first frame corresponds to the largest value of the grid for the associated index.

Experimental.

This command requires the installation of ffmpeg.

den_plot_o2graph(o2scl, amp, link, args)

Documentation for o2graph command den-plot:

For objects of type table3d:

Create a density plot from a slice of a table3d

Command-line arguments: <slice> [kwargs]

Creates a density plot from the specified slice. A z-axis density legend is displayed on the RHS if colbar is set to True before plotting. If z-axis limits are specified, then values larger than the upper limit are set equal to the upper limit and values smaller than the lower limit are set equal to the lower limit before plotting.

The python function imshow() is used, unless ‘pcm=True’ is specified, in which case the pcolormesh() function is used instead. When ‘pcm=False’, logarithmic scales are handled by taking the base 10 log of the x- or y-grids specified in the table3d object before plotting. When ‘pcm=True’, logarithmic axes can be handled automatically. The imshow() function presumes a uniform linear or logarithmic x- and y-axis grid, and the den-plot function will output a warning if this is not the case. The pcolormesh() function can handle arbitrary x and y-axis grids. If logz is set to true, then the base 10 logarithm is taken of the data before the density plot is constructed.

Some useful kwargs are cmap, interpolation (for imshow), alpha, vmin, and vmax.

See https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.imshow.html and https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.pcolormesh.html for more information and keyword arguments.

For objects of type hist_2d:

Create a density plot from a hist_2d object

Command-line arguments: [kwargs]

Creates a density plot from the current two-dimensional histogram. A z-axis density legend is displayed on the RHS if colbar is set to True before plotting. If z-axis limits are specified, then values larger than the upper limit are set equal to the upper limit and values smaller than the lower limit are set equal to the lower limit before plotting.

The python function imshow() is used, unless ‘pcm=True’ is specified, in which case the pcolormesh() function is used instead. When ‘pcm=False’, logarithmic scales are handled by taking the base 10 log of the x- or y-grids specified in the table3d object before plotting. When ‘pcm=True’, logarithmic axes can be handled automatically. The imshow() function presumes a uniform linear or logarithmic x- and y-axis grid, and the den-plot function will output a warning if this is not the case. The pcolormesh() function can handle arbitrary x and y-axis grids. If logz is set to true, then the base 10 logarithm is taken of the data before the density plot is constructed.

Some useful kwargs are cmap, interpolation (for imshow), alpha, vmin, and vmax.

See https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.imshow.html and https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.pcolormesh.html for more information and keyword arguments.

For objects of type tensor:

Create a density plot from a tensor object.

Command-line arguments: [index_1 index_2] [kwargs]

If the tensor has rank 2 and the indices are not specified, then plot the first index along the x-axis and the second index along the y-axis. A z-axis density legend is print on the RHS if colbar is set to 1 before plotting. If z-axis limits are specified, then values larger than the upper limit are set equal to the upper limit and values smaller than the lower limit are set equal to the lower limit before plotting.

For objects of type tensor<int>:

Create a density plot from a tensor<int> object.

Command-line arguments: [index_1 index_2] [kwargs]

If the tensor has rank 2 and the indices are not specified, then plot the first index along the x-axis and the second index along the y-axis. A z-axis density legend is print on the RHS if colbar is set to 1 before plotting. If z-axis limits are specified, then values larger than the upper limit are set equal to the upper limit and values smaller than the lower limit are set equal to the lower limit before plotting.

For objects of type tensor<size_t>:

Create a density plot from a tensor<size_t> object.

Command-line arguments: [index_1 index_2] [kwargs]

If the tensor has rank 2 and the indices are not specified, then plot the first index along the x-axis and the second index along the y-axis. A z-axis density legend is print on the RHS if colbar is set to 1 before plotting. If z-axis limits are specified, then values larger than the upper limit are set equal to the upper limit and values smaller than the lower limit are set equal to the lower limit before plotting.

For objects of type tensor_grid:

Create a density plot from a tensor_grid object.

Command-line arguments: [index_1 index_2] [kwargs]

If the tensor has rank 2 and the indices are not specified, then plot the first index along the x-axis and the second index along the y-axis. A z-axis density legend is print on the RHS if colbar is set to 1 before plotting. If z-axis limits are specified, then values larger than the upper limit are set equal to the upper limit and values smaller than the lower limit are set equal to the lower limit before plotting.

den_plot_rgb_o2graph(o2scl, amp, link, args)

Documentation for o2graph command den-plot-rgb:

For objects of type table3d:

Create a density plot from a specified slice

Command-line arguments: <slice r> <slice g> <slice b> [kwargs]

Create a density plot from the three specified slices. This command uses imshow(). To directly create a .png file with no axes, use make-png instead. For example:

o2graph -create table3d x "grid:0,1,0.01" y "grid:0,1,0.01" \
r "x" -function "y" g -function 0 b -den-plot-rgb r g b -show
ell_max(amp, link, args)

Desc

errorbar(o2scl, amp, link, args)

Documentation for o2graph command errorbar:

For objects of type table:

Plot the specified columns with errorbars.

Command-line arguments: <x> <y> <xerr> <yerr> [kwargs]

Plot column <y> versus column <x> with symmetric error bars given in column <xerr> and <yerr>. For no uncertainty in either the x or y direction, just use 0 for <xerr> or <yerr>, respectively.

Some useful kwargs for the errorbar command are:

keyword

description

default value

ecolor

error bar color

None

elinewidth

error bar line width

None

capsize

cap size in points

None

barsabove

plot error bars on top of points

False

lolims

y value is lower limit

False

uplims

y value is upper limit

False

xlolims

x value is lower limit

False

xuplims

x value is upper limit

False

errorevery

draw error bars on subset of data

1

capthick

thickness of error bar cap

None

For error points with no lines use, e.g. lw=0,elinewidth=1. See also error-point for plotting a single point with errorbars.

filter_image(fname)

If a filter has been defined, apply that filter to the image stored in file fname. This function is used in yt_save_annotate() to filter the images after saving them to a file.

gen_acol(o2scl, amp, link, cmd_name, args)

Run a general acol command named cmd_name with arguments stored in args. This function uses the O2scl function o2scl_acol_parse().

get_wrapper(o2scl, amp, args)

Wrapper around o2sclpy.plot_base.get() which gets plot-related parameters and gets other parameters from acol_manager.

gltf_o2graph(o2scl, amp, link, args)

Documentation for o2graph command gltf:

Write a GLTF file from 3D objects (experimental)

Command-line arguments: <prefix> [kwargs]

Write a GLTF file from 3D objects.

help_func(o2scl, amp, link, args)

Function to process the help command.

hist2d_plot(o2scl, amp, link, args)

Documentation for o2graph command hist2d-plot:

For objects of type table:

Create a 2D histogram plot from two columns in a table

Command-line arguments: <col x> <col y> [kwargs]

Create a 2D histogram plot from the specified columns. This command uses matplotlib to construct the histogram rather than using O2scl to create a hist object.

hist_plot(o2scl, amp, link, args)

Documentation for o2graph command hist-plot:

For objects of type table:

Create a histogram plot from a column in a table

Command-line arguments: <col> [kwargs]

For a table, create a histogram plot from the specified column. This command uses matplotlib to construct the histogram rather than using O2scl to create a histogram object. This command uses the matplotlib hist() function, see https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.hist.html for information and keyword arguments.

For objects of type hist:

Create a histogram plot from the current histogram.

Command-line arguments: [kwargs]

Create a histogram plot from the current histogram. This command uses the matplotlib hist() function, see https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.hist.html for information and keyword arguments.

kde_2d_plot(o2scl, amp, args, link)

Documentation for o2graph command kde-2d-plot:

For objects of type table:

Plot a KDE of two columns

Command-line arguments: <column x> <column y> [plot kwargs] [kde kwargs]

This command converts the two columns to a matrix and two vectors which define the x and y grids. Useful plot kwargs are all the usual plotting kwargs, plus x_min=0, x_max=0, y_min=0, y_max=0, z_mult=1, and n_points=201. Similar to the command kde-plot, if x_max is less than x_min then the limits on the x grid are either taken from the parameters xlo and xhi if they are set, or otherwise computed from the minimum and maximum of the specified x column. Otherwise, if x_max is smaller than x_min, then those values are used as the limits for the KDE (which need not correspond to xlo and xhi). The same holds for y_min, y_max, and the y grid. The number of points between x_min and x_max and between y_min and y_max is determined by the n_points parameter. The z vector is multiplied by y_mult before plotting.

Useful KDE kwargs are kernel=’gaussian’, metric=’euclidean’, transform=’unit’, and bandwidth=’none’.

kde_plot(o2scl, amp, args, link)

Documentation for o2graph command kde-plot:

For objects of type table:

Plot a KDE of one column

Command-line arguments: <column> [plot kwargs] [kde kwargs]

This command takes the column of the table, computes a one-dimensional KDE, and then uses that KDE to fill two vectors, an x and y vector to plot the data. Useful plot kwargs are all the usual plotting kwargs, plus x_min=0, x_max=0, y_mult=1, and n_points=201. If x_max is less than x_min then the limits on the x vector are either taken from the parameters xlo and xhi if they are set, or otherwise computed from the minimum and maximum of the data. Otherwise, if x_max is smaller than x_min, then those values are used as the limits for the KDE (which need not correspond to xlo and xhi). The number of points between x_min and x_max is determined by the n_points parameter. The y vector is multiplied by y_mult before plotting.

Useful KDE kwargs are kernel=’gaussian’, metric=’euclidean’, transform=’unit’, and bandwidth=’none’.

make_png_o2graph(o2scl, amp, link, args)

Documentation for o2graph command make-png:

For objects of type table3d:

Command-line arguments: <slice r> <slice g> <slice b> [kwargs]

Create a .png file from the three specified table3d slices. This command requires pillow. To create a density-plot with axes instead, use den-plot-rgb.

mp4(args, loop=False, vf='')

Documentation for o2graph command mp4:

Create an mp4 file from a series of images.

Command-line arguments: <pattern> <output>

Typical patterns are “prefix%02dsuffix” and outputs are “out.mp4”. If the “mp4” suffix is omitted, it is automatically added.

A typical video filter is e.g. vf=’eq=brightness=0.5:contrast=10’.

This command requires the installation of ffmpeg.

parse_argv(argv, o2scl, link)

Parse command-line arguments.

This is the main function used by the O₂graph script . Once it has created a list of strings from argv, it calls parse_string_list() to call the proper functions. It creates the pointer to the o2scl acol_manager object called amp.

parse_string_list(strlist, o2scl, amp, link)

Parse a list of strings.

This function is called by parse_argv().

plot1(o2scl, amp, link, args)

Documentation for o2graph command plot1:

For objects of type table:

Plot the specified column

Command-line arguments: <y> [kwargs]

Plot column <y> versus row number. Some useful kwargs are color (c), dashes, linestyle (ls), linewidth (lw), marker, markeredgecolor (mec), markeredgewidth (mew), markerfacecolor (mfc), markerfacecoloralt (mfcalt), markersize (ms). For example: “o2graph -create x 0 10 0.2 -function sin(x) y -plot1 y ls=’–‘,marker=’o’ -show”. This command uses the matplotlib plot() function, see https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.plot.html for information and keyword arguments. This command does not yet support the matplotlib format parameter.

For objects of type double[]:

Plot the array.

Command-line arguments: [kwargs]

Plot the array. Some useful kwargs are color (c), dashes, linestyle (ls), linewidth (lw), marker, markeredgecolor (mec), markeredgewidth (mew), markerfacecolor (mfc), markerfacecoloralt (mfcalt), markersize (ms). https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.plot.html for information and keyword arguments. This command does not yet support the matplotlib format parameter.

For objects of type int[]:

Plot the array.

Command-line arguments: [kwargs]

Plot the array. Some useful kwargs are color (c), dashes, linestyle (ls), linewidth (lw), marker, markeredgecolor (mec), markeredgewidth (mew), markerfacecolor (mfc), markerfacecoloralt (mfcalt), markersize (ms). https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.plot.html for information and keyword arguments. This command does not yet support the matplotlib format parameter.

For objects of type size_t[]:

Plot the array.

Command-line arguments: [kwargs]

Plot the array. Some useful kwargs are color (c), dashes, linestyle (ls), linewidth (lw), marker, markeredgecolor (mec), markeredgewidth (mew), markerfacecolor (mfc), markerfacecoloralt (mfcalt), markersize (ms). https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.plot.html for information and keyword arguments. This command does not yet support the matplotlib format parameter.

plot_color(o2scl, amp, link, args)

Documentation for o2graph command plot-color:

For objects of type table:

Plot three columns, using the third for the color

Command-line arguments: <x> <y> <c> <cmap> [kwargs]

Plot column <y> versus column <x> using column <c> to specify the line color. Some useful kwargs are color (c), dashes, linestyle (ls), linewidth (lw), marker, markeredgecolor (mec), markeredgewidth (mew), markerfacecolor (mfc), markerfacecoloralt (mfcalt), markersize (ms). For example:

o2graph -create x 0 10 0.2 -function sin(x) y -plot x y \
lw=0,marker='+' -show

This command uses the matplotlib plot() function, see https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.plot.html for information and keyword arguments. This command does not yet support the matplotlib format parameter.

If a cmyt colormap is used, then the cmyt Python package is required.

plot_o2graph(o2scl, amp, args, link)

Documentation for o2graph command plot:

For objects of type table:

Plot two columns.

Command-line arguments: <x> <y> [kwargs]

Plot column <y> versus column <x>. Some useful kwargs are color (c), dashes, linestyle (ls), linewidth (lw), marker, markeredgecolor (mec), markeredgewidth (mew), markerfacecolor (mfc), markerfacecoloralt (mfcalt), markersize (ms). For example:

o2graph -create table x grid:0,10,0.2 -function "sin(x)" y \
-plot x y "lw=0,marker=+" -show 

This command uses the matplotlib plot() function, see https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.plot.html for information and keyword arguments. This command does not yet support the matplotlib format parameter.

For objects of type vec_vec_double:

Plot one or two columns.

Command-line arguments: <x index> [y index or 'none'] [kwargs]

Plot vector with index [index y] versus vector with index <index x>. Alternatively, if the second argument is the string ‘none’, plot the vector with index <index x>. Some useful kwargs are color (c), dashes, linestyle (ls), linewidth (lw), marker, markeredgecolor (mec), markeredgewidth (mew), markerfacecolor (mfc), markerfacecoloralt (mfcalt), markersize (ms). For example:

o2graph -create vec_vec_double grid:0,10,0.2 "func:51:sin(i)" \
-plot 0 1 "lw=0,marker=+" -show

This command uses the matplotlib plot() function, see https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.plot.html for information and keyword arguments. This command does not yet support the matplotlib format parameter.

For objects of type hist:

Plot the histogram

Command-line arguments: [kwargs]

Plot the histogram weights as a function of the bin representative values. Some useful kwargs (which apply for all three object types) are color (c), dashes, linestyle (ls), linewidth (lw), marker, markeredgecolor (mec), markeredgewidth (mew), markerfacecolor (mfc), markerfacecoloralt (mfcalt), markersize (ms). For example:

o2graph -create table x grid:0,10,0.01 \
-function "abs(sin(x))" y -to-hist y 20 \
-plot "lw=0,marker=+" -show

This command uses the matplotlib plot() function, see https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.plot.html for information and keyword arguments. This command does not yet support the matplotlib format parameter.

For objects of type vector<contour_line>:

Plot the contour lines.

Command-line arguments: [kwargs]

Plot the set of contour lines. Some useful kwargs (which apply for all three object types) are color (c), dashes, linestyle (ls), linewidth (lw), marker, markeredgecolor (mec), markeredgewidth (mew), markerfacecolor (mfc), markerfacecoloralt (mfcalt), markersize (ms). For example:

o2graph -create table3d x grid:0,1,0.02 y grid:0,1,0.02 z \
"(exp(-(x-0.2)^2/0.1)+exp(-(x-0.9)^2/0.1))*exp(-(y-0.4)^2/0.1)" \
-contours 0.5 z -plot "lw=2" -show 

This command uses the matplotlib plot() function, see https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.plot.html for information and keyword arguments. This command does not yet support the matplotlib format parameter.

For objects of type prob_dens_mdim_amr:

Plot the probability distribution.

Command-line arguments: [kwargs]

Plot the set of contour lines. Some useful kwargs (which apply for all three object types) are color (c), dashes, linestyle (ls), linewidth (lw), marker, markeredgecolor (mec), markeredgewidth (mew), markerfacecolor (mfc), markerfacecoloralt (mfcalt), markersize (ms). This command uses the matplotlib plot() function, see https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.plot.html for information and keyword arguments. This command does not yet support the matplotlib format parameter.

plotv(o2scl, amp, link, args)

Documentation for o2graph command plotv:

Plot several vector-like data sets.

Command-line arguments: [multiple vector spec. for x] <multiple vector spec. for y>

The plotv command plots one or several pairs of vectors for x and y. The total number of curves plotted will be the number of vector data sets from the first argument times the number of vector data sets from the second argument. If the x and y vector lengths are not equal, then the longer vector is truncated. Any kwargs are applied to all curves plotted. For details on multiple vector specifications, use o2graph -help mult-vector-spec.

There is an additional keyword argument filter. The filter is parsed through the python eval() function and all pairs of points for which the function evaluates to False are omitted from the plot. Local variables of interest are x and y, corresponding to the x and y value at each point, and k, the current array index.

print_param_docs(amt)

Print parameter documentation.

Called by help_func().

restore_focus(foc)

Restore the value of self.yt_focus from the array ‘foc’.

restore_north(nor)

Restore the value of self.yt_north from the array ‘nor’.

restore_position(pos)

Restore the value of self.yt_position from the array ‘pos’ which is …

restore_width(wid)

Restore the value of self.yt_width from the array ‘wid’.

rplot(o2scl, amp, link, args)

Documentation for o2graph command rplot:

For objects of type table:

Plot a region inside a column or in between two columns.

Command-line arguments: <x1> <y1> [x2 y2] [kwargs]

If either 2 or 3 arguments are specified, this command plots the region inside the curve defined by the specified set of x and y values. The first point is copied at the end to ensure a closed region. If 4 or 5 arguments are specified, then this command plots the region in between two sets of x and y values, again adding the first point from (x1,y1) to the end to ensure a closed region.

scatter(o2scl, amp, link, args)

Documentation for o2graph command scatter:

For objects of type table:

Create a scatter plot from 2-4 columns.

Command-line arguments: <x> <y> [s] [c] [kwargs]

This command creates a scatter plot form columns <x> and <y>, optionally using column [s] to choose the marker size and optionally using column [c] to choose the marker color. To vary the marker colors while choosing the default marker size just specify ‘None’ as the argument for [s]. Or, to specify keyword arguments while using the default size and color, specify ‘None’ as the argument for both [s] and [c].

set_wrapper(o2scl, amp, link, args)

Wrapper around o2sclpy.plot_base.set() which sets plot-related parameters and sends other parameters to acol_manager.

to_kde(o2scl, amp, link, args)

Documentation for o2graph command to-kde:

For objects of type table:

Convert columns in a table to a KDE (unfinished)

Command-line arguments: <options or 'none'> <column 1> [column 2] ...

Desc.

yt_add_vol(o2scl, amp, link, args, keyname='o2graph_vol')

Documentation for o2graph command yt-add-vol:

For objects of type tensor_grid:

Add a tensor_grid object as a yt volume source

Command-line arguments: [kwargs]

This command adds the volumetric data specified in the tensor_grid object as a yt volume source. The transfer function previously specified by yt-tf is used, or if unspecified, then yt’s transfer_function_helper is used to create a 3 layer default transfer function.

yt_ann_func(o2scl, amp, args)

Documentation for o2graph command yt-ann:

Annotate a yt rendering (experimental).

Command-line arguments: [args]

The yt-ann command adds a list of o2graph commands that can be used to annotate a yt rendering. Annotations are normal o2graph 2D plotting commands built upon a coordinate system with (0,0) as the lower-left corner of the image and (1,1) as the upper-right corner. Arguments for yt-ann may include dashes but must end with the word ‘end’.

For example:

-yt-ann -text 0.1 0.95 "Ann. example" color=w,ha=left end

The list or arguments in args must end with ‘end’. If args contains only one entry (‘end’), then the list of annotations is cleared.

yt_mesh(o2scl, amp, link, args)

Plot a mesh from vertices specified by a slice of O2scl table3d object.

yt_path_func(o2scl, amp, args)

Documentation for o2graph command yt-path:

Add a path to the yt animation.

Command-line arguments: <type> <number of frames> <other parameters>

The yt-path adds a path to a yt animation. To rotate the camera around the z-axis, use ‘yaw’ <n_frames> <angle>, where angle is a fraction of a full rotation to perform by the end of the animation. To zoom the camera, use ‘zoom’ <n_frames> <factor> ,where factor is the total zoom factor to apply over all n_frames. To move the camera along a line, use ‘move’ <n_frames> <[dest_x,dest_y,dest_z]> <’internal’ or ‘user’>, where the third argument is the destination in either the internal or user-specified coordinate system. To turn the camera without moving it, use ‘turn’ <n_frames> <[foc_x,foc_y,foc_z]> <’internal’ or ‘user’>. Executing ‘yt-path reset’ resets the yt animation path to an empty list (for no animation).

yt_render(o2scl, amp, link, fname, mov_fname='', loop=False)

Documentation for o2graph command yt-render:

Render the yt volume visualization.

Command-line arguments: <filename or pattern> [kwargs]

Perform the volume rendering. If yt_path is empty, then the first argument is the filename. If yt_path is not empty then the first argument is a filename pattern containing * where each frame will be stored. If yt_path is not empty and a movie filename is given, then ffmpeg will be used to combine the frames into an mp4 file.

The keyword argument mov_fname specifies the output movie file (if an animation is specified with yt-path). If empty, the filename o2graph.mp4 is used.

This command requires the installation of ffmpeg.

yt_save_annotate(o2scl, amp, link, fname)

Create a .png image, then add 2D annotations, save to file named ‘fname’, and then apply any filters

yt_scatter(o2scl, amp, link, args)

Documentation for o2graph command yt-scatter:

For objects of type table:

Add scattered points to a yt scene

Command-line arguments: <x column> <y column> <z column> [size column] [red column] [green column] [blue column] [alpha column]

Add a series of points to a yt scene. If a volume has not yet been added, then a default volume is added. If the x, y-, or z-axis limits have not yet been set, then they are set by the limits of the data. If the size column is unspecified, ‘none’, or ‘None’, then the default value of 3 is used. If the color columns are unspecified, ‘none’ or ‘None’, then [1,1,1] is used, and finally the default for the alpha column is 0.5. If any of the values for the color columns are less than zero or greater than 1, then that color column is rescaled to [0,1].

yt_tf_func(args)

Documentation for o2graph command yt-tf:

Edit the yt transfer function.

Command-line arguments: <mode> <args>

To create a new transfer function, use ‘new’ for <mode> and the remaining <args> are <min> <max> [nbins] .To add a Gaussian, use ‘gauss’ for <mode> and <args> are <loc> <width> <red> <green> <blue>, and <alpha>. To add a step function, use ‘step’ <low> <high> <red> <green> <blue>, and <alpha>. To plot the transfer function, use ‘plot’ <filename>.

yt_vertex_list(o2scl, amp, link, args)

Documentation for o2graph command yt-vertex-list:

For objects of type table:

Draw a line from a series of vertices in a table.

Command-line arguments: <x column> <y column> <z column> [kwargs]

Create a series of yt LineSource objects in a visualization using the three specified columns as vertices. One line segment will be drawn from the values in the first row to the values in the second row, one line segment from the second row to the third row, and so on.