Options¶
-
pytplot.
options
(name, option=None, value=None, opt_dict=None)[source]¶ This function allows the user to set a large variety of options for individual plots.
Parameters: - name – str Name or number of the tplot variable
- option – str The name of the option. See section below.
- value – str/int/float/list The value of the option. See section below.
- dict – dict This can be a dictionary of option:value pairs. Option and value will not be needed if this dictionary item is supplied.
- Options:
Options Value type Notes Color str/list red, green, blue, etc. Also takes in RGB tuples, i.e. (0,255,0) for green Colormap str/list https://matplotlib.org/examples/color/colormaps_reference.html. Spec int 1 sets the Tplot Variable to spectrogram mode, 0 reverts. Alt int 1 sets the Tplot Variable to altitude plot mode, 0 reverts. Map int 1 sets the Tplot Variable to latitude/longitude mode, 0 reverts. link list Allows a user to reference one tplot variable to another. ylog int 1 sets the y axis to log scale, 0 reverts. zlog int 1 sets the z axis to log scale, 0 reverts (spectrograms only). legend_names list A list of strings that will be used to identify the lines. xlog_slice bool Sets x axis on slice plot to log scale if True. ylog bool Set y axis on main plot window to log scale if True. ylog_slice bool Sets y axis on slice plot to log scale if True. zlog bool Sets z axis on main plot window to log scale if True. line_style str scatter (to make scatter plots), or solid_line, dot, dash, dash_dot, dash_dot_dot_dot, long_dash. char_size int Defines character size for plot labels, etc. name str The title of the plot. panel_size flt Number between (0,1], representing the percent size of the plot. basemap str Full path and name of a background image for “Map” plots. alpha flt Number between [0,1], gives the transparancy of the plot lines. thick flt Sets plot line width. yrange flt list Two numbers that give the y axis range of the plot. zrange flt list Two numbers that give the z axis range of the plot. xrange_slice flt list Two numbers that give the x axis range of spectrogram slicing plots. yrange_slice flt list Two numbers that give the y axis range of spectrogram slicing plots. ytitle str Title shown on the y axis. ztitle str Title shown on the z axis. Spec plots only. ysubtitle str Subtitle shown on the y axis. zsubtitle str Subtitle shown on the z axis. Spec plots only. plotter str Allows a user to implement their own plotting script in place of the ones herein. crosshair_x str Title for x-axis crosshair. crosshair_y str Title for y-axis crosshair. crosshair_z str Title for z-axis crosshair. static str Datetime string that gives desired time to plot y and z values from a spec plot. static_tavg str Datetime string that gives desired time-averaged y and z values to plot from a spec plot. t_average int Seconds around which the cursor is averaged when hovering over spectrogram plots. ‘spec_plot_dim’ int If variable two dimensions, this sets which dimension the variable will have on on the y axis. All other dimensions are summed into this one.
Returns: None Examples
>>> # Change the y range of Variable1 >>> import pytplot >>> x_data = [1,2,3,4,5] >>> y_data = [1,2,3,4,5] >>> pytplot.store_data("Variable1", data={'x':x_data, 'y':y_data}) >>> pytplot.options('Variable1', 'yrange', [2,4])
>>> # Change Variable1 to use a log scale >>> pytplot.options('Variable1', 'ylog', 1)