plot_pandas | df :pd.DataFrame, x_var="SYSTEM TIME", fields=None,
colors=None, title=None, title_prefix=None,
range_x=None, range_y=None,
x_label=None, y_label="Y", legend_header="Plot",
vertical_lines_to_add=None,
show_intervals=False, show=False | pgo.Figure |
Using plotly, draw line plots from the values in the given dataframe.
Note: if this plot is to be later combined with others, use PlotlyHelper.combine_plots()
:param df: Pandas dataframe with the data for the plot
:param x_var: Name of column with independent variable for the x-axis
:param fields: Name, or list of names, of the dataframe columns whose values are to be plotted;
if a list is passed, also display a figure legend;
if None, then display all columns except the one that is declared as the independent variable
:param colors: (OPTIONAL) Either a single color (string with standard plotly name, such as "red"),
or list of names to use, in order; if None, then the hardwired default colors are used
:param title: (OPTIONAL) Title for the plot
:param title_prefix: (OPTIONAL) Strint to prefixed (automatically followed by " ") to the title
:param range_x: (OPTIONAL) list of the form [t_start, t_end], to initially show only a part of the timeline.
Note: it's still possible to zoom out, and see the excluded portion
:param range_y: (OPTIONAL) list of the form [y_min, y_max], to initially show only a part of the y values.
Note: it's still possible to zoom out, and see the excluded portion
:param x_label: (OPTIONAL) Caption to use for the x-axis
:param y_label: (OPTIONAL) Caption to use for the y-axis. Default: "Y"
:param legend_header: (OPTIONAL) Caption to use at the top of the legend box.
Only applicable if more than 1 curve is being shown.
:param vertical_lines_to_add: (OPTIONAL) Ignored if the argument `show_intervals` is specified.
Value, or list, or tuple, or Numpy array, or Pandas series,
of x-coordinate(s) at which to draw thin vertical dotted gray lines.
If the number of vertical line is so large as to overwhelm the plot,
only a sample of them is shown.
Note that vertical lines, if requested, go into the plot's "layout";
as a result they might not appear if this plot is later combined with another one.
:param show_intervals: (OPTIONAL) If True, it over-rides any value passed to the `vertical_lines` argument,
and draws thin vertical dotted gray lines at all the x-coords
of the data points in the saved history data;
also, it adds a comment to the title.
:param show: If True, the plot will be shown
Note: on JupyterLab, simply returning a plot object (without assigning it to a variable)
leads to it being automatically shown
:return: A plotly "Figure" object
|