Py.Cafe

maartenbreddels/

matplotlib-bar-chart

Matplotlib Bar Chart with pypalettes

DocsPricing
  • app.py
  • requirements.txt
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import solara
import matplotlib.pyplot as plt

from pypalettes import load_cmap
cmap = load_cmap("Abbott")



@solara.component
def Page():

    # Data
    names = ['Jean', 'Nicolas', 'Mark', 'Marion', 'Emily', 'Mélanie', 'Gabriel', 'Robert', 'Paul']
    values = [100, 90, 80, 70, 60, 50, 40, 30, 20]

    # Plot
    fig, ax = plt.subplots()

    bars = ax.barh(names, values, color=['#8B0000', '#FF4500', '#D2B48C', '#A0522D', '#228B22', '#2E8B57', '#20B2AA', '#4682B4', '#708090'])

    plt.show()
requirements.txt
1
2
3
solara
pypalettes
matplotlib