Skip to content

Commit 567cc96

Browse files
committed
update for new plt
1 parent 4d6bdaa commit 567cc96

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

matplotlibTUT/plt9_tick_visibility.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
y = 0.1*x
1919

2020
plt.figure()
21-
plt.plot(x, y, linewidth=10)
21+
plt.plot(x, y, linewidth=10, zorder=1) # set zorder for ordering the plot in plt 2.0.2 or higher
2222
plt.ylim(-2, 2)
2323
ax = plt.gca()
2424
ax.spines['right'].set_color('none')
@@ -32,5 +32,6 @@
3232

3333
for label in ax.get_xticklabels() + ax.get_yticklabels():
3434
label.set_fontsize(12)
35-
label.set_bbox(dict(facecolor='white', edgecolor='None', alpha=0.7))
35+
# set zorder for ordering the plot in plt 2.0.2 or higher
36+
label.set_bbox(dict(facecolor='white', edgecolor='none', alpha=0.8, zorder=2))
3637
plt.show()

0 commit comments

Comments
 (0)