Skip to content

Instantly share code, notes, and snippets.

@blairconrad
Created July 15, 2021 14:30
Show Gist options
  • Save blairconrad/ea411bd0d0f626a6b9c515b4a4f5ed4b to your computer and use it in GitHub Desktop.
Save blairconrad/ea411bd0d0f626a6b9c515b4a4f5ed4b to your computer and use it in GitHub Desktop.
import pygal
from pygal.style import Style
# Define the style
custom_style = Style(
colors=("#0343df", "#e50000", "#ffff14", "#929591"),
font_family="Roboto,Helvetica,Arial,sans-serif",
background="transparent",
label_font_size=14,
)
# Set up the bar plot, ready for data
c = pygal.Bar(
title="Restart times",
style=custom_style,
y_title="time",
width=1200,
x_label_rotation=270,
)
with open("timings.txt") as timings_file:
timings = [float(t.strip()) for t in timings_file]
c.add("Restart Time", timings)
c.render_to_file("pygal.svg")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment