# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: 'Python 3.8.10 64-bit (''sparkbadge'': virtualenv)'
#     name: python3
# ---

# # API references
#
# - [plot](https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.plot.html#matplotlib.pyplot.plot)
# - [figure](https://matplotlib.org/stable/api/figure_api.html?highlight=figure#module-matplotlib.figure)
# - [text](https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.text.html?highlight=text#matplotlib.pyplot.text)

import numpy as np
import matplotlib.pyplot as plt

# # Bar chart
#
# Just as a warmup...

mu, sigma = 100, 15
x = range(10)
plt.bar(x, [0, 2, 0, 1, 1, 2, 0, 0, 1, 1])

# # Build status: color mesh

success, pending, failure = 0.7, 0.4, 0.1
fig = plt.figure(figsize=[9, 3], frameon=False)
plt.pcolormesh([[success, success, failure, success, failure, pending, success, failure, failure, pending, failure, success]],vmin=0, vmax=1, cmap='Spectral')
plt.axis('off')
plt.savefig('bars.svg', bbox_inches='tight', pad_inches=0)

# # Quantitative data: sparkline

x = [1, 2, 3, 4, 5]
y = [1, 3.3, 4, 6, 6.6]
fig = plt.figure(figsize=[9, 3], frameon=False)
plt.axis('off')
plt.plot(x,y, linewidth=5)
plt.arrow(5, 6.6, 0.5, 0.3, length_includes_head=True, head_width=0.5, edgecolor=None)
plt.savefig('plot.svg', bbox_inches='tight', pad_inches=0)

# # Drawing the badge label

fig = plt.figure(figsize=[9, 3], frameon=False)
plt.axis('off')
plt.text(0, 0, "wasup", color='white', backgroundcolor='purple', fontsize=150, ma='center')
plt.savefig('text.svg', bbox_inches='tight', pad_inches=0)

StarcoderdataJupyterScriptsDedupFiltered