@@ -75,11 +75,11 @@ def _plot_args_replacer(args, data):
7575 except ValueError :
7676 pass
7777 else :
78- msg = "Second argument '{}' is ambiguous: could be a color spec " \
79- "but is in data. Using as data. \n Either rename the " \
80- "entry in data or use three arguments " \
81- " to plot." .format (args [1 ])
82- warnings . warn ( msg , RuntimeWarning , stacklevel = 3 )
78+ warnings . warn (
79+ "Second argument {!r} is ambiguous: could be a color spec but "
80+ "is in data; using as data. Either rename the entry in data "
81+ "or use three arguments to plot." .format (args [1 ]),
82+ RuntimeWarning , stacklevel = 3 )
8383 return ["x" , "y" ]
8484 elif len (args ) == 3 :
8585 return ["x" , "y" , "c" ]
@@ -2857,13 +2857,6 @@ def errorbar(self, x, y, yerr=None, xerr=None,
28572857 holdstate = self ._hold
28582858 self ._hold = True
28592859
2860- if fmt is None :
2861- fmt = 'none'
2862- msg = ('Use of None object as fmt keyword argument to ' +
2863- 'suppress plotting of data values is deprecated ' +
2864- 'since 1.4; use the string "none" instead.' )
2865- warnings .warn (msg , mplDeprecation , stacklevel = 1 )
2866-
28672860 plot_line = (fmt .lower () != 'none' )
28682861 label = kwargs .pop ("label" , None )
28692862
@@ -3398,8 +3391,7 @@ def _update_dict(dictionary, rc_name, properties):
33983391 if usermedians is not None :
33993392 if (len (np .ravel (usermedians )) != len (bxpstats ) or
34003393 np .shape (usermedians )[0 ] != len (bxpstats )):
3401- medmsg = 'usermedians length not compatible with x'
3402- raise ValueError (medmsg )
3394+ raise ValueError ('usermedians length not compatible with x' )
34033395 else :
34043396 # reassign medians as necessary
34053397 for stats , med in zip (bxpstats , usermedians ):
@@ -4039,9 +4031,9 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
40394031 colors = mcolors .to_rgba_array (c )
40404032 except ValueError :
40414033 # c not acceptable as PathCollection facecolor
4042- msg = ("c of shape {0 } not acceptable as a color sequence "
4043- " for x with size {1 }, y with size {2}" )
4044- raise ValueError ( msg .format (c .shape , x .size , y .size ))
4034+ raise ValueError ("c of shape {} not acceptable as a color "
4035+ "sequence for x with size {}, y with size {}"
4036+ .format (c .shape , x .size , y .size ))
40454037 else :
40464038 colors = None # use cmap, norm after collection is created
40474039
@@ -4089,8 +4081,8 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
40894081
40904082 if colors is None :
40914083 if norm is not None and not isinstance (norm , mcolors .Normalize ):
4092- msg = "'norm' must be an instance of 'mcolors.Normalize'"
4093- raise ValueError ( msg )
4084+ raise ValueError (
4085+ "'norm' must be an instance of 'mcolors.Normalize'" )
40944086 collection .set_array (np .asarray (c ))
40954087 collection .set_cmap (cmap )
40964088 collection .set_norm (norm )
@@ -4448,8 +4440,8 @@ def hexbin(self, x, y, C=None, gridsize=100, bins=None,
44484440 accum = bins .searchsorted (accum )
44494441
44504442 if norm is not None and not isinstance (norm , mcolors .Normalize ):
4451- msg = "'norm' must be an instance of 'mcolors.Normalize'"
4452- raise ValueError ( msg )
4443+ raise ValueError (
4444+ "'norm' must be an instance of 'mcolors.Normalize'" )
44534445 collection .set_array (accum )
44544446 collection .set_cmap (cmap )
44554447 collection .set_norm (norm )
@@ -5191,8 +5183,8 @@ def imshow(self, X, cmap=None, norm=None, aspect=None,
51915183 self .cla ()
51925184
51935185 if norm is not None and not isinstance (norm , mcolors .Normalize ):
5194- msg = "'norm' must be an instance of 'mcolors.Normalize'"
5195- raise ValueError ( msg )
5186+ raise ValueError (
5187+ "'norm' must be an instance of 'mcolors.Normalize'" )
51965188 if aspect is None :
51975189 aspect = rcParams ['image.aspect' ]
51985190 self .set_aspect (aspect )
@@ -5514,8 +5506,8 @@ def pcolor(self, *args, **kwargs):
55145506 collection .set_alpha (alpha )
55155507 collection .set_array (C )
55165508 if norm is not None and not isinstance (norm , mcolors .Normalize ):
5517- msg = "'norm' must be an instance of 'mcolors.Normalize'"
5518- raise ValueError ( msg )
5509+ raise ValueError (
5510+ "'norm' must be an instance of 'mcolors.Normalize'" )
55195511 collection .set_cmap (cmap )
55205512 collection .set_norm (norm )
55215513 collection .set_clim (vmin , vmax )
@@ -5663,8 +5655,8 @@ def pcolormesh(self, *args, **kwargs):
56635655 collection .set_alpha (alpha )
56645656 collection .set_array (C )
56655657 if norm is not None and not isinstance (norm , mcolors .Normalize ):
5666- msg = "'norm' must be an instance of 'mcolors.Normalize'"
5667- raise ValueError ( msg )
5658+ raise ValueError (
5659+ "'norm' must be an instance of 'mcolors.Normalize'" )
56685660 collection .set_cmap (cmap )
56695661 collection .set_norm (norm )
56705662 collection .set_clim (vmin , vmax )
@@ -5787,8 +5779,8 @@ def pcolorfast(self, *args, **kwargs):
57875779 vmin = kwargs .pop ('vmin' , None )
57885780 vmax = kwargs .pop ('vmax' , None )
57895781 if norm is not None and not isinstance (norm , mcolors .Normalize ):
5790- msg = "'norm' must be an instance of 'mcolors.Normalize'"
5791- raise ValueError ( msg )
5782+ raise ValueError (
5783+ "'norm' must be an instance of 'mcolors.Normalize'" )
57925784
57935785 C = args [- 1 ]
57945786 nr , nc = C .shape
0 commit comments