Matplotlib Cards
Card types:
barplot
,boxplot
,flightEnvelope
,histogram
,lineplot
,matplotlib
,scatterplot
,tachometer
,trafficLight
Datacards includes a number of matplotlib-based cards for visualizing data.
In addition to the common parameters the matplotlib cards have the following configuration options:
Name | Type | Required | Description |
---|---|---|---|
figure | dict | Yes | The matplotlib figure to be displayed. |
value | int or float | No | The value to be displayed (only for histogram /boxplot ). |
unit | str | No | The unit of the value (only for histogram /boxplot ). |
These cards are created using a combination of matplotlib  and helper functions provided by DataCards. For more detailed information, please refer to the DataCards plotting utilities documentation.
Example: Boxplot
# Prepare data
x = [3, 4, 5, 2, 5, 5, 8, -1]
label = 'Boxplot'
x_label = 'avg [psi]'
thumbnail = True # if True, fewer information will be displayed
avg = sum(x) / len(x)
# In this cell I load the standard styling in DataCards
from matplotlib import pyplot as plt
plt.style.use('datacards-dark-mode')
# In this cell I create the overall plot layout
fig, ax = datacards.utilities.plotting.boxplot(
x=x,
thumbnail=thumbnail
)
datacards.publish.card(
type='boxplot',
fig=fig,
label='Boxplot',
value=42,
unit='Unit'
)
Last updated on