User Tools

Site Tools


other:python:matplotlib_by_jyp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
other:python:matplotlib_by_jyp [2020/02/11 12:55]
jypeter [Starting (and more) with matplotlib]
other:python:matplotlib_by_jyp [2020/03/31 10:49]
jypeter [Misc Matplotlib tricks] Improved
Line 187: Line 187:
 ===== Misc Matplotlib tricks ===== ===== Misc Matplotlib tricks =====
  
-  * Specifying the background color of a plot (e.g. when plotting ​a masked variable ​and you don't want the masked areas to be white) +==== Specifying the background color of a plot ==== 
-    * ''​# make the background dark gray (call this before the contourf)''​\\ ''​plt.gca().patch.set_color('​.25'​)''​\\ ''​plt.contourf(d)''​\\ ''​plt.show()''​ + 
-    ​* ​[[https://​stackoverflow.com/​questions/​9797520/​masking-part-of-a-contourf-plot-in-matplotlib|trick source]]+e.g. You need to plot a masked variable, but you don't want the masked areas to be white 
 + 
 +<​code>​# make the background dark gray (call this before the contourf) 
 +plt.gca().patch.set_color('​.25'​) 
 +plt.contourf(d) 
 +plt.show()</​code>​ 
 + 
 +[[https://​stackoverflow.com/​questions/​9797520/​masking-part-of-a-contourf-plot-in-matplotlib|trick source]]
  
  
other/python/matplotlib_by_jyp.txt · Last modified: 2023/10/26 08:39 by jypeter