aboutsummaryrefslogtreecommitdiff
path: root/assets/posts/dna-sequence/chart-size.py
diff options
context:
space:
mode:
Diffstat (limited to 'assets/posts/dna-sequence/chart-size.py')
-rw-r--r--assets/posts/dna-sequence/chart-size.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/assets/posts/dna-sequence/chart-size.py b/assets/posts/dna-sequence/chart-size.py
new file mode 100644
index 0000000..4fc408d
--- /dev/null
+++ b/assets/posts/dna-sequence/chart-size.py
@@ -0,0 +1,28 @@
1import csv
2
3import matplotlib.pyplot as plt
4import pandas as pd
5
6# Read the data
7df = pd.read_csv("benchmarks.csv")
8
9# Settings
10plt.title("Encode to FASTA out filesize")
11plt.tight_layout(pad=2)
12fig = plt.gcf()
13fig.set_size_inches(10, 4)
14
15# Plotting
16plt.plot(df["Packages"], df["FASTA file size (KB)"], label = "Raw", color="black", linestyle="-")
17plt.plot(df["Packages"], df["FASTA gzipped (KB)"], label = "Gzipped", color="black", linestyle="--")
18
19# Adding x and y axis labels
20plt.xlabel("Size of an input file", fontstyle="italic")
21plt.ylabel("File size (KB)", fontstyle="italic")
22
23# Legend
24legend = plt.legend()
25legend.get_frame().set_linewidth(0)
26
27# Export as SVG
28plt.savefig("chart-size.svg", format="svg")