Created
July 15, 2021 14:30
-
-
Save blairconrad/ea411bd0d0f626a6b9c515b4a4f5ed4b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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