Get Started
UI Examples/Tutorials
- What is zero-true?
- State in zero-true
- User State in zero-true
- Buttons in Zero-True
- Sliders in zero-true
- Range Sliders in zero-true
- Text Inputs in zero-true
- Text Areas in zero-true
- Displaying a Pandas DataFrame in zero-true
- Displaying a Matplotlib Plot in zero-true
- Displaying a Plotly Plot in zero-true
- CLI
- App Bar
- Toolbar
- Cell Types
- Cells
- Layout
- Publishing
API reference
Matplotlib
Below are the various attributes you can assign to the component. Utilizing them can allow for modifications to the pre-created object.
id (string): Unique id for a component
src (string): Source URL of the image of the graph
alt (string): Alternative text for the graph image
width (integer | string): Width of the graph
height (integer | string): Height of the graph
Example Usage
import zero_true as zt
import pandas as pd
import matplotlib.pyplot as plt
# Some sample data pulled from Wikipedia
table_MN = pd.read_html('https://en.wikipedia.org/wiki/Minnesota')
example_data = table_MN[6]
example_data['Country'] = example_data['Country'].str.replace(r"\[.*\]", "", regex=True)
plt.clf()
plt.bar(example_data["Country"], example_data["Population"])
plt.xlabel("Country")
plt.ylabel("Values")
plt.xticks(rotation=90)
plt.subplots_adjust(bottom=0.3)
zt.matplotlib(id='plot', figure=plt.gcf(), width=200, height=600)
Example Output
Assistant
Responses are generated using AI and may contain mistakes.