aboutsummaryrefslogtreecommitdiff
path: root/static/assets/posts/dna-sequence/chart-size.py
blob: 4fc408dadbd9448cdc2e089136e7b8144df02eea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import csv

import matplotlib.pyplot as plt
import pandas as pd

# Read the data
df = pd.read_csv("benchmarks.csv")

# Settings
plt.title("Encode to FASTA out filesize")
plt.tight_layout(pad=2)
fig = plt.gcf()
fig.set_size_inches(10, 4)

# Plotting
plt.plot(df["Packages"], df["FASTA file size (KB)"], label = "Raw", color="black", linestyle="-")
plt.plot(df["Packages"], df["FASTA gzipped (KB)"], label = "Gzipped", color="black", linestyle="--")

# Adding x and y axis labels
plt.xlabel("Size of an input file", fontstyle="italic")
plt.ylabel("File size (KB)", fontstyle="italic")

# Legend
legend = plt.legend()
legend.get_frame().set_linewidth(0)

# Export as SVG
plt.savefig("chart-size.svg", format="svg")