BubbleChart¶
-
class
pandas_alive.charts.
BubbleChart
(df: pandas.core.frame.DataFrame, interpolate_period: bool, steps_per_period: int, period_length: int, period_fmt: str, figsize: Tuple[float, float], title: str, fig: matplotlib.figure.Figure, cmap: Union[str, matplotlib.colors.Colormap, List[str]], tick_label_size: Union[int, float, str], period_label: Union[bool, Dict[str, Union[int, float, str]]], period_summary_func: Callable, fixed_max: bool, dpi: int, writer: str, enable_progress_bar: bool, kwargs, x_data_label: str, y_data_label: str, size_data_label: Union[int, float, str], color_data_label: str, vmin: Union[int, float], vmax: Union[int, float])[source]¶ Multivariate Bubble charts from MultiIndex
Generate animated bubble charts with multivariate data (x,y at a minimum must be supplied) Optionally supply data for colour and/or size
- Parameters
_BaseChart ([type]) – Base chart for all chart classes
- Raises
ValueError – [description]
Methods
BubbleChart.__init__
(df, interpolate_period, …)Initialize self.
Animation function, removes bubbles and updates legend/period annotation.
Apply styling to axes with spines and grid, can be overridden
BubbleChart.calculate_new_figsize
(real_fig)Calculate figure size to allow for labels, etc
Function to remove all existing lines, collections, etc at the start of the animation AND after a save.
Create base figure with styling, can be overridden if styling unwanted
BubbleChart.get_colors
(cmap)Get colours for plotting data
Get list of columns containing plottable numeric data to plot
Method for determining range of frames to animate.
Convert the animation to an HTML5 <video> tag.
Get interpolated dataframe to span total animation
BubbleChart.get_period_label
(period_label)Parameters for period annotation on charts, dict will be passed to kwargs in matplotlib.ax.text()
BubbleChart.get_single_color
(color_string)Get single RBGA value from string
Initialization function for animation
BubbleChart.make_animation
(frames, init_func)Method for creating animation
Plot points from MultiIndexed DataFrame
Converts all column names to string
BubbleChart.save
(filename)Save method for FuncAnimation.
BubbleChart.set_x_y_limits
(df, i, ax)Set axis limits for both x and y of passed axes object
Create an instance of alive-progress bar in manual mode
Show period label on plot
Update TQDM instance by 1
Validate figure is a matplotlib Figure instance