networkcommons.visual.lollipop_plot

networkcommons.visual.lollipop_plot(df, label_col, value_col, orientation='vertical', color_palette='tab10', size=10, linewidth=2, label_fontsize=10, label_gap=0.1, rounding_decimals=2, marker='o', title='', plt_size=(12, 8), filepath=None, render=False)

Function to plot metrics using a lollipop plot from a DataFrame.

Parameters:
  • df (pd.DataFrame) – DataFrame containing the data.

  • label_col (str) – Column name for labels.

  • value_col (str) – Column name for values.

  • orientation (str) – ‘vertical’ or ‘horizontal’. Default is ‘vertical’.

  • color_palette (str) – Matplotlib color palette. Default is ‘tab10’.

  • size (int) – Size of the markers. Default is 10.

  • linewidth (int) – Line width of the lollipops. Default is 2.

  • label_fontsize (int) – Font size for the labels. Default is 10.

  • label_gap (float) – Gap between the value and the label. Default is 0.1.

  • marker (str) – Marker style for the lollipops. Default is ‘o’.

  • rounding_decimals (int) – Number of decimal places to round the values to. Default is 2.

  • title (str) – Title of the plot. Default is ‘’.

  • plt_size (tuple) – Size of the plot. Default is (12, 8).

  • filepath (str) – Path to save the plot. Default is None.

  • render (bool) – Whether to display the plot. Default is False.

Return type:

Figure