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

Skip to content

Commit f37b23a

Browse files
committed
Prefer "none" to "None" in docs, examples and comments.
(Markers are left untouched, as they don't support "none"; nor are linestyles, for which the "canonical" version is still "None".)
1 parent b9ea8ce commit f37b23a

File tree

9 files changed

+28
-33
lines changed

9 files changed

+28
-33
lines changed

examples/axes_grid1/inset_locator_demo.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
bbox_transform=ax.transAxes, loc=3)
7070

7171
# For visualization purposes we mark the bounding box by a rectangle
72-
ax.add_patch(plt.Rectangle((.2, .4), .6, .5, ls="--", ec="c", fc="None",
72+
ax.add_patch(plt.Rectangle((.2, .4), .6, .5, ls="--", ec="c", fc="none",
7373
transform=ax.transAxes))
7474

7575
# We set the axis limits to something other than the default, in order to not
@@ -89,9 +89,9 @@
8989
bbox_transform=ax3.transAxes)
9090

9191
# For visualization purposes we mark the bounding box by a rectangle
92-
ax2.add_patch(plt.Rectangle((0, 0), 1, 1, ls="--", lw=2, ec="c", fc="None"))
92+
ax2.add_patch(plt.Rectangle((0, 0), 1, 1, ls="--", lw=2, ec="c", fc="none"))
9393
ax3.add_patch(plt.Rectangle((.7, .5), .3, .5, ls="--", lw=2,
94-
ec="c", fc="None"))
94+
ec="c", fc="none"))
9595

9696
# Turn ticklabels off
9797
for axi in [axins2, axins3, ax2, ax3]:

examples/lines_bars_and_markers/marker_reference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def split_list(a_list):
117117
fig.suptitle('Mathtext markers', fontsize=14)
118118
fig.subplots_adjust(left=0.4)
119119

120-
marker_style.update(markeredgecolor="None", markersize=15)
120+
marker_style.update(markeredgecolor="none", markersize=15)
121121
markers = ["$1$", r"$\frac{1}{2}$", "$f$", "$\u266B$", r"$\mathcal{A}$"]
122122

123123
for y, marker in enumerate(markers):

examples/shapes_and_collections/compound_path.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
path = Path(vertices, codes)
2525

26-
pathpatch = PathPatch(path, facecolor='None', edgecolor='green')
26+
pathpatch = PathPatch(path, facecolor='none', edgecolor='green')
2727

2828
fig, ax = plt.subplots()
2929
ax.add_patch(pathpatch)

examples/statistics/errorbars_and_boxes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141

4242
def make_error_boxes(ax, xdata, ydata, xerror, yerror, facecolor='r',
43-
edgecolor='None', alpha=0.5):
43+
edgecolor='none', alpha=0.5):
4444

4545
# Loop over data points; create box from errors at each point
4646
errorboxes = [Rectangle((x - xe[0], y - ye[0]), xe.sum(), ye.sum())
@@ -55,7 +55,7 @@ def make_error_boxes(ax, xdata, ydata, xerror, yerror, facecolor='r',
5555

5656
# Plot errorbars
5757
artists = ax.errorbar(xdata, ydata, xerr=xerror, yerr=yerror,
58-
fmt='None', ecolor='k')
58+
fmt='none', ecolor='k')
5959

6060
return artists
6161

lib/matplotlib/axes/_axes.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3317,8 +3317,7 @@ def errorbar(self, x, y, yerr=None, xerr=None,
33173317
%(Line2D:kwdoc)s
33183318
"""
33193319
kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D)
3320-
# anything that comes in as 'None', drop so the default thing
3321-
# happens down stream
3320+
# Drop anything that comes in as None to use the default instead.
33223321
kwargs = {k: v for k, v in kwargs.items() if v is not None}
33233322
kwargs.setdefault('zorder', 2)
33243323

lib/matplotlib/axes/_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,7 @@ def cla(self):
12911291
self.patch = self._gen_axes_patch()
12921292
self.patch.set_figure(self.figure)
12931293
self.patch.set_facecolor(self._facecolor)
1294-
self.patch.set_edgecolor('None')
1294+
self.patch.set_edgecolor('none')
12951295
self.patch.set_linewidth(0)
12961296
self.patch.set_transform(self.transAxes)
12971297

lib/matplotlib/lines.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,15 +1093,15 @@ def set_linestyle(self, ls):
10931093
10941094
- A string:
10951095
1096-
=============================== =================
1097-
Linestyle Description
1098-
=============================== =================
1099-
``'-'`` or ``'solid'`` solid line
1100-
``'--'`` or ``'dashed'`` dashed line
1101-
``'-.'`` or ``'dashdot'`` dash-dotted line
1102-
``':'`` or ``'dotted'`` dotted line
1103-
``'None'`` or ``' '`` or ``''`` draw nothing
1104-
=============================== =================
1096+
========================================== =================
1097+
linestyle description
1098+
========================================== =================
1099+
``'-'`` or ``'solid'`` solid line
1100+
``'--'`` or ``'dashed'`` dashed line
1101+
``'-.'`` or ``'dashdot'`` dash-dotted line
1102+
``':'`` or ``'dotted'`` dotted line
1103+
``'none'``, ``'None'``, ``' '``, or ``''`` draw nothing
1104+
========================================== =================
11051105
11061106
- Alternatively a dash tuple of the following form can be
11071107
provided::

lib/matplotlib/patches.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -419,18 +419,15 @@ def set_linestyle(self, ls):
419419
"""
420420
Set the patch linestyle.
421421
422-
=========================== =================
423-
linestyle description
424-
=========================== =================
425-
``'-'`` or ``'solid'`` solid line
426-
``'--'`` or ``'dashed'`` dashed line
427-
``'-.'`` or ``'dashdot'`` dash-dotted line
428-
``':'`` or ``'dotted'`` dotted line
429-
``'None'`` draw nothing
430-
``'none'`` draw nothing
431-
``' '`` draw nothing
432-
``''`` draw nothing
433-
=========================== =================
422+
========================================== =================
423+
linestyle description
424+
========================================== =================
425+
``'-'`` or ``'solid'`` solid line
426+
``'--'`` or ``'dashed'`` dashed line
427+
``'-.'`` or ``'dashdot'`` dash-dotted line
428+
``':'`` or ``'dotted'`` dotted line
429+
``'none'``, ``'None'``, ``' '``, or ``''`` draw nothing
430+
========================================== =================
434431
435432
Alternatively a dash tuple of the following form can be provided::
436433

lib/mpl_toolkits/mplot3d/axes3d.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3033,8 +3033,7 @@ def errorbar(self, x, y, z, zerr=None, yerr=None, xerr=None, fmt='',
30333033
had_data = self.has_data()
30343034

30353035
kwargs = cbook.normalize_kwargs(kwargs, mlines.Line2D)
3036-
# anything that comes in as 'None', drop so the default thing
3037-
# happens down stream
3036+
# Drop anything that comes in as None to use the default instead.
30383037
kwargs = {k: v for k, v in kwargs.items() if v is not None}
30393038
kwargs.setdefault('zorder', 2)
30403039

0 commit comments

Comments
 (0)