diff options
Diffstat (limited to 'public/posts/dna-sequence/chart-size.py')
| -rw-r--r-- | public/posts/dna-sequence/chart-size.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/public/posts/dna-sequence/chart-size.py b/public/posts/dna-sequence/chart-size.py new file mode 100644 index 0000000..4fc408d --- /dev/null +++ b/public/posts/dna-sequence/chart-size.py | |||
| @@ -0,0 +1,28 @@ | |||
| 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 out filesize") | ||
| 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["FASTA file size (KB)"], label = "Raw", color="black", linestyle="-") | ||
| 17 | plt.plot(df["Packages"], df["FASTA gzipped (KB)"], label = "Gzipped", color="black", linestyle="--") | ||
| 18 | |||
| 19 | # Adding x and y axis labels | ||
| 20 | plt.xlabel("Size of an input file", fontstyle="italic") | ||
| 21 | plt.ylabel("File size (KB)", fontstyle="italic") | ||
| 22 | |||
| 23 | # Legend | ||
| 24 | legend = plt.legend() | ||
| 25 | legend.get_frame().set_linewidth(0) | ||
| 26 | |||
| 27 | # Export as SVG | ||
| 28 | plt.savefig("chart-size.svg", format="svg") | ||
