- Notifications
You must be signed in to change notification settings - Fork 908
/
Copy pathtip-dual-axis.py
30 lines (21 loc) · 721 Bytes
/
tip-dual-axis.py
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
29
30
importpathlib
importnumpyasnp
importmatplotlibasmpl
importmatplotlib.pyplotasplt
ROOT_DIR=pathlib.Path(__file__).parent.parent
mpl.rcParams['axes.linewidth'] =1.5
fig=plt.figure(figsize=(2, 2))
d=0.01
ax1=fig.add_axes([d, d, 1-2*d, 1-2*d], label="cartesian")
ax2=fig.add_axes([d, d, 1-2*d, 1-2*d], projection="polar", label="polar")
ax1.set_xticks([]) # np.linspace(0.0, 0.4, 5))
ax1.set_yticks([]) # np.linspace(0.0, 1.0, 11))
ax2.set_rorigin(0)
ax2.set_thetamax(90)
ax2.set_ylim(0.5, 1.0)
ax2.set_xticks(np.linspace(0, np.pi/2, 10))
ax2.set_yticks(np.linspace(0.5, 1.0, 5))
ax2.set_xticklabels([])
ax2.set_yticklabels([])
fig.savefig(ROOT_DIR/"figures/tip-dual-axis.pdf")
# plt.show()