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

Skip to content
5 changes: 3 additions & 2 deletions galleries/examples/color/named_colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def plot_colortable(colors, *, ncols=4, sort_colors=True):
cell_height = 22
swatch_width = 48
margin = 12
ncols = 4

# Sort colors by hue, saturation, value and name.
if sort_colors is True:
Expand All @@ -42,14 +43,14 @@ def plot_colortable(colors, *, ncols=4, sort_colors=True):
n = len(names)
nrows = math.ceil(n / ncols)

width = cell_width * 4 + 2 * margin
width = cell_width * ncols + 2 * margin
height = cell_height * nrows + 2 * margin
dpi = 72

fig, ax = plt.subplots(figsize=(width / dpi, height / dpi), dpi=dpi)
fig.subplots_adjust(margin/width, margin/height,
(width-margin)/width, (height-margin)/height)
ax.set_xlim(0, cell_width * 4)
ax.set_xlim(0, cell_width * ncols)
ax.set_ylim(cell_height * (nrows-0.5), -cell_height/2.)
ax.yaxis.set_visible(False)
ax.xaxis.set_visible(False)
Expand Down
6 changes: 3 additions & 3 deletions galleries/plot_types/3D/scatter3d_simple.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
==============
3D scatterplot
==============
================
scatter(x, y, z)
================

See `~mpl_toolkits.mplot3d.axes3d.Axes3D.scatter`.
"""
Expand Down
2 changes: 1 addition & 1 deletion galleries/plot_types/3D/surface3d_simple.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
=====================
3D surface
plot_surface(X, Y, Z)
=====================

See `~mpl_toolkits.mplot3d.axes3d.Axes3D.plot_surface`.
Expand Down
6 changes: 3 additions & 3 deletions galleries/plot_types/3D/trisurf3d_simple.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
======================
Triangular 3D surfaces
======================
=====================
plot_trisurf(x, y, z)
=====================

See `~mpl_toolkits.mplot3d.axes3d.Axes3D.plot_trisurf`.
"""
Expand Down
6 changes: 3 additions & 3 deletions galleries/plot_types/3D/voxels_simple.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
==========================
3D voxel / volumetric plot
==========================
=================
voxels([x, y, z])
=================

See `~mpl_toolkits.mplot3d.axes3d.Axes3D.voxels`.
"""
Expand Down
6 changes: 3 additions & 3 deletions galleries/plot_types/3D/wire3d_simple.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
=================
3D wireframe plot
=================
=======================
plot_wireframe(X, Y, Z)
=======================

See `~mpl_toolkits.mplot3d.axes3d.Axes3D.plot_wireframe`.
"""
Expand Down