milkviz.bubble#

milkviz.bubble(data: Optional[pd.DataFrame] = None, x: str | List | np.ndarray = None, y: str | List | np.ndarray = None, hue: str | List | np.ndarray = None, size: str | List | np.ndarray = None, cmap: Any = None, sizes: Tuple[int, int] = (10, 250), dtype: Any = None, legend_kw: Dict = None, cbar_kw: Dict = None, ax: mpl.axes.Axes = None) mpl.axes.Axes#

Bubble plot

Parameters
  • data – Data use to plot, should be a dataframe

  • x – Either a key in data or a numpy array

  • y – Either a key in data or a numpy array

  • hue – The color array that map to marker colors

  • size – The size array that map to marker sizes

  • cmap – The colormap to be used, either a cmap name or a matplotlib.cm.ColorMap, default to “RdBu”

  • sizes – The size range of circle markers, (min, max)

  • dtype – Only coerce the value display on the legend, does not affect plotting

  • legend_kw – The options to configure legend

  • cbar_kw – The options to configure colorbar

  • ax – Pre-existing axes for the plot. Or a new one will be created.

Returns

A matplotlib.axes.Axes instance