File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- 2009-03-20 Add AuxTransformBox in offsetbox.py to support some transformation.
2- anchored_text.py example is enhanced and renamed
1+ 2009-03-25 Make contour and contourf handle nan in their Z argument. - EF
2+
3+ 2009-03-20 Add AuxTransformBox in offsetbox.py to support some transformation.
4+ anchored_text.py example is enhanced and renamed
35 (anchored_artists.py). - JJL
46
572009-03-20 Add "bar" connection style for annotation - JJL
Original file line number Diff line number Diff line change 33origin = 'lower'
44#origin = 'upper'
55
6- test_masking = False # There is a bug in filled contour masking.
6+ # The following controls only interior masking.
7+ test_masking = False # There is a bug in filled contour masking with
8+ # interior masks.
79
810if test_masking :
911 # Use a coarse grid so only a few masked points are needed.
3032 Z [0 ,0 ] = 0
3133 Z = ma .array (Z , mask = badmask )
3234
35+ nr , nc = Z .shape
36+
37+ # put NaNs in one corner:
38+ Z [- nr // 6 :, - nc // 6 :] = nan
39+ # contourf will convert these to masked
40+
41+
42+ Z = ma .array (Z )
43+ # mask another corner:
44+ Z [:nr // 6 , :nc // 6 ] = ma .masked
45+
46+
3347# We are using automatic selection of contour levels;
3448# this is usually not such a good idea, because they don't
3549# occur on nice boundaries, but we do it here for purposes
4862 origin = origin ,
4963 hold = 'on' )
5064
51- title ('Nonsense' )
65+ title ('Nonsense (with 2 masked corners) ' )
5266xlabel ('word length anomaly' )
5367ylabel ('sentence length anomaly' )
5468
7286 colors = ('k' ,),
7387 linewidths = (3 ,),
7488 origin = origin )
75- title ('Listed colors' )
89+ title ('Listed colors (with 2 masked corners) ' )
7690clabel (CS4 , fmt = '%2.1f' , colors = 'w' , fontsize = 14 )
7791colorbar (CS3 )
7892
Original file line number Diff line number Diff line change @@ -756,6 +756,7 @@ def _contour_args(self, *args):
756756 x ,y ,z = self ._check_xyz (args [:3 ])
757757 else :
758758 raise TypeError ("Too many arguments to %s; see help(%s)" % (fn ,fn ))
759+ z = ma .masked_invalid (z , copy = False )
759760 self .zmax = ma .maximum (z )
760761 self .zmin = ma .minimum (z )
761762 if self .logscale and self .zmin <= 0 :
You can’t perform that action at this time.
0 commit comments