-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplot.py
23 lines (19 loc) · 873 Bytes
/
plot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python3
from alpsplot import Figure
from alpsplot.colormap import ting_color
x = [0, 2.5, 5, 10, 20, 30, 40]
y = [93.78, 93.79, 93.30, 92.16, 90.58, 88.77, 86.13]
if __name__ == '__main__':
fig = Figure('poison_percent_cifar10')
fig.set_axis_label('x', 'Poison Percent (%)')
fig.set_axis_label('y', 'Model Accuracy Drop (%)')
fig.set_axis_lim('x', lim=[0, 40], piece=4, margin=[1.0, 1.0],
_format=None)
fig.set_axis_lim('y', lim=[0, 100], piece=5, margin=[1.0, 1.0],
_format='%d')
fig.lineplot(x=x, y=y, color=ting_color['red'])
fig.scatter(x=x, y=y, color=ting_color['red'],
marker='H', label='resnet', curve_legend=True)
fig.set_legend()
fig.ax.ticklabel_format(style='sci', axis='x', scilimits=(0, 0), useMathText=True)
fig.save(folder_path='./result')