seaborn

python plot

scatter plot with different marker

1sns.scatterplot(data=test, x="acc", y="span",
2                color=".2",
3                marker="+"
4            )
5plt.title('401 gene from paper')
6plt.xlabel('average accuracy')
7plt.ylabel('length of hsp')

scatter plot with color changing on dot

1plt.figure()
2sns.scatterplot(data=opt_finding, x="seq_len", y="span", hue="loss")
3plt.show()

barplot with tag on each bar showing value, x label rotating, however there might be some offset on the labels too long

 1g = sns.barplot(data=species_csv, x='species', y="r_gene_num_2")
 2# g.set_xticklabels(rotation=30)
 3
 4for p in g.patches:
 5    g.annotate(format(p.get_height(), 
 6                      '.0f'
 7                     ), 
 8                   (p.get_x() + p.get_width() / 2., p.get_height()), 
 9                   ha = 'center', va = 'center', 
10                   xytext = (0, 9), 
11                   textcoords = 'offset points'
12              )
13plt.xticks(rotation=45)
14plt.title("2. seq len > 100")
The Latest