Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 082495c

Browse files
authored
Merge pull request #18919 from brunobeltran/contourf-hatch-demo-fix
DOCS: fix contourf hatch demo legend
2 parents e547e70 + 18e7a71 commit 082495c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/images_contours_and_fields/contourf_hatching.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
extend='lower')
3737

3838
# create a legend for the contour set
39-
artists, labels = cs.legend_elements()
40-
ax2.legend(artists, labels, handleheight=2)
39+
artists, labels = cs.legend_elements(str_format='{:2.1f}'.format)
40+
ax2.legend(artists, labels, handleheight=2, framealpha=1)
4141
plt.show()
4242

4343
#############################################################################

0 commit comments

Comments
 (0)