plotly_aggplot

hhpy.plotting.plotly_aggplot(data: pandas.core.frame.DataFrame, x: Union[int, float, str, bytes, None], y: Union[int, float, str, bytes, None], hue: Union[int, float, str, bytes, None] = None, groupby: Union[Sequence[T_co], int, float, str, bytes, None, AbstractSet[T_co]] = None, sep: str = ';', agg: str = 'sum', hue_order: Union[list, str] = None, x_min: Union[int, float, str, bytes, None] = None, x_max: Union[int, float, str, bytes, None] = None, y_min: Union[int, float, str, bytes, None] = None, y_max: Union[int, float, str, bytes, None] = None, mode: str = 'lines+markers', title: str = None, xaxis_title: str = None, yaxis_title: str = None, label_maxchar: int = 15, direction: str = 'up', showactive: bool = True, dropdown_x: float = 0, dropdown_y: float = -0.1, fig: plotly.graph_objs._figure.Figure = None, do_print: bool = True, kws_dropdown: Mapping[KT, VT_co] = None, kws_fig: Mapping[KT, VT_co] = None, **kwargs) → plotly.graph_objs._figure.Figure[source]

create a (grouped) plotly aggplot that let’s you select the groupby categories

Parameters:
  • data – Pandas DataFrame containing named data, optional if vector data is used
  • x – Name of the x variable in data
  • y – Name of the y variable in data
  • hue – Further split the plot by the levels of this variable [optional]
  • groupby – Column name(s) to split the plot by [optional]
  • sep – Separator used for groupby columns [optional]
  • agg – Aggregate function to use [optional]
  • hue_order

    Either a string describing how the (hue) levels or to be ordered or an explicit list of levels to be used for plotting. Accepted strings are:

    • sorted: following python standard sorting conventions (alphabetical for string, ascending for value)
    • inv: following python standard sorting conventions but in inverse order
    • count: sorted by value counts
    • mean, mean_ascending, mean_descending: sorted by mean value, defaults to descending
    • median, mean_ascending, median_descending: sorted by median value, defaults to descending
  • x_min – Lower limit for the x axis [optional]
  • x_max – Upper limit for the x axis [optional]
  • y_min – Lower limit for the y axis [optional]
  • y_max – Upper limit for the y axis [optional]
  • mode – plotly mode [optional]
  • title – Figure title, passed to plotly.Figure.update_layout [optional]
  • xaxis_title – x axis title, passed to plotly.Figure.update_layout [optional]
  • yaxis_title – y axis title, passed to plotly.Figure.update_layout [optional]
  • label_maxchar – Maximum allowed number of characters of the labels [optional]
  • direction – One of [‘up’, ‘down’] , direction of the dropdown [optional]
  • showactive – Whether to show the active selection in the dropdown [optional]
  • dropdown_x – x position of the first dropdown [optional]
  • dropdown_y – y position of the first dropdown [optional]
  • fig – The plotly.Figure object to draw the plot on [optional]
  • do_print – Whether to print intermediate steps to console [optional]
  • kws_dropdown – Other keyword arguments passed to the dropdown updatemenu [optional]
  • kws_fig – other keyword arguments passed to plotly.graph_objects.Figure [optional]
  • kwargs – other keyword arguments passed to plotly.graph_objects.scatter [optional]
Returns:

plotly Figure with the plot on it