diff options
Diffstat (limited to 'static/assets/posts/dna-sequence/chart-speed.py')
| -rw-r--r-- | static/assets/posts/dna-sequence/chart-speed.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/static/assets/posts/dna-sequence/chart-speed.py b/static/assets/posts/dna-sequence/chart-speed.py new file mode 100644 index 0000000..c07b057 --- /dev/null +++ b/static/assets/posts/dna-sequence/chart-speed.py | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | import csv | ||
| 2 | |||
| 3 | import matplotlib.pyplot as plt | ||
| 4 | import pandas as pd | ||
| 5 | |||
| 6 | # Read the data | ||
| 7 | df = pd.read_csv("benchmarks.csv") | ||
| 8 | |||
| 9 | # Settings | ||
| 10 | plt.title("Encode to FASTA speed over time") | ||
| 11 | plt.tight_layout(pad=2) | ||
| 12 | fig = plt.gcf() | ||
| 13 | fig.set_size_inches(10, 4) | ||
| 14 | |||
| 15 | # Plotting | ||
| 16 | plt.plot(df["Packages"], df["Encode to FASTA (ms)"], label = "ALB", color="black", linestyle="--") | ||
| 17 | |||
| 18 | # Adding x and y axis labels | ||
| 19 | plt.xlabel("Size of an input file", fontstyle="italic") | ||
| 20 | plt.ylabel("Encoding time (ms)", fontstyle="italic") | ||
| 21 | |||
| 22 | # Export as SVG | ||
| 23 | plt.savefig("chart-speed.svg", format="svg") | ||
