diff --git a/galleries/examples/color/named_colors.py b/galleries/examples/color/named_colors.py index c6cba68ab434..96612c353c90 100644 --- a/galleries/examples/color/named_colors.py +++ b/galleries/examples/color/named_colors.py @@ -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: @@ -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) diff --git a/galleries/plot_types/3D/scatter3d_simple.py b/galleries/plot_types/3D/scatter3d_simple.py index 023a46448ccf..ef2f8443ca80 100644 --- a/galleries/plot_types/3D/scatter3d_simple.py +++ b/galleries/plot_types/3D/scatter3d_simple.py @@ -1,7 +1,7 @@ """ -============== -3D scatterplot -============== +================ +scatter(x, y, z) +================ See `~mpl_toolkits.mplot3d.axes3d.Axes3D.scatter`. """ diff --git a/galleries/plot_types/3D/surface3d_simple.py b/galleries/plot_types/3D/surface3d_simple.py index b421469b821d..04f74d5edd14 100644 --- a/galleries/plot_types/3D/surface3d_simple.py +++ b/galleries/plot_types/3D/surface3d_simple.py @@ -1,6 +1,6 @@ """ ===================== -3D surface +plot_surface(X, Y, Z) ===================== See `~mpl_toolkits.mplot3d.axes3d.Axes3D.plot_surface`. diff --git a/galleries/plot_types/3D/trisurf3d_simple.py b/galleries/plot_types/3D/trisurf3d_simple.py index 6bf3dc0835d5..b32bd3ebc69a 100644 --- a/galleries/plot_types/3D/trisurf3d_simple.py +++ b/galleries/plot_types/3D/trisurf3d_simple.py @@ -1,7 +1,7 @@ """ -====================== -Triangular 3D surfaces -====================== +===================== +plot_trisurf(x, y, z) +===================== See `~mpl_toolkits.mplot3d.axes3d.Axes3D.plot_trisurf`. """ diff --git a/galleries/plot_types/3D/voxels_simple.py b/galleries/plot_types/3D/voxels_simple.py index c3473e108969..5e6dcffb87f1 100644 --- a/galleries/plot_types/3D/voxels_simple.py +++ b/galleries/plot_types/3D/voxels_simple.py @@ -1,7 +1,7 @@ """ -========================== -3D voxel / volumetric plot -========================== +================= +voxels([x, y, z]) +================= See `~mpl_toolkits.mplot3d.axes3d.Axes3D.voxels`. """ diff --git a/galleries/plot_types/3D/wire3d_simple.py b/galleries/plot_types/3D/wire3d_simple.py index 8ce1a460617e..1ab847f3ecf4 100644 --- a/galleries/plot_types/3D/wire3d_simple.py +++ b/galleries/plot_types/3D/wire3d_simple.py @@ -1,7 +1,7 @@ """ -================= -3D wireframe plot -================= +======================= +plot_wireframe(X, Y, Z) +======================= See `~mpl_toolkits.mplot3d.axes3d.Axes3D.plot_wireframe`. """