Dataset Viewer
Auto-converted to Parquet Duplicate
image
imagewidth (px)
75
2.22k
code
stringlengths
300
16.2k
example_id
stringlengths
28
79
figure_index
int64
0
26
figure_name
stringclasses
28 values
title
stringlengths
38
94
example_page_url
stringlengths
61
195
source_url
stringlengths
80
111
source_relpath
stringlengths
6
37
category_hint
stringclasses
24 values
status
stringclasses
1 value
num_figures
int64
1
27
error
null
""" ======================== Anchored Direction Arrow ======================== """ import matplotlib.pyplot as plt import numpy as np import matplotlib.font_manager as fm from mpl_toolkits.axes_grid1.anchored_artists import AnchoredDirectionArrows # Fixing random state for reproducibility np.random.seed(19680801) f...
stable__gallery__axes_grid1__demo_anchored_direction_arrows
0
figure_000.png
Anchored Direction Arrow — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axes_grid1/demo_anchored_direction_arrows.html#sphx-glr-download-gallery-axes-grid1-demo-anchored-direction-arrows-py
https://matplotlib.org/stable/_downloads/82ac862070a073a69fc9b974db5ab46b/demo_anchored_direction_arrows.py
demo_anchored_direction_arrows.py
axes_grid1
ok
1
null
""" ============ Axes divider ============ Axes divider to calculate location of Axes and create a divider for them using existing Axes instances. """ import matplotlib.pyplot as plt from matplotlib import cbook def get_demo_image(): z = cbook.get_sample_data("axes_grid/bivariate_normal.npy") # 15x15 array ...
stable__gallery__axes_grid1__demo_axes_divider
0
figure_000.png
Axes divider — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axes_grid1/demo_axes_divider.html#sphx-glr-download-gallery-axes-grid1-demo-axes-divider-py
https://matplotlib.org/stable/_downloads/52e9d9c67d12b0707ec2ebfda10937f5/demo_axes_divider.py
demo_axes_divider.py
axes_grid1
ok
1
null
""" ============== Demo Axes Grid ============== Grid of 2x2 images with a single colorbar or with one colorbar per Axes. """ import matplotlib.pyplot as plt from matplotlib import cbook from mpl_toolkits.axes_grid1 import ImageGrid fig = plt.figure(figsize=(10.5, 2.5)) Z = cbook.get_sample_data("axes_grid/bivariat...
stable__gallery__axes_grid1__demo_axes_grid
0
figure_000.png
Demo Axes Grid — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axes_grid1/demo_axes_grid.html#sphx-glr-download-gallery-axes-grid1-demo-axes-grid-py
https://matplotlib.org/stable/_downloads/e59c7fc1ea02b23c213a2688aba898cc/demo_axes_grid.py
demo_axes_grid.py
axes_grid1
ok
1
null
""" ========== Axes Grid2 ========== Grid of images with shared xaxis and yaxis. """ import matplotlib.pyplot as plt import numpy as np from matplotlib import cbook from mpl_toolkits.axes_grid1 import ImageGrid def add_inner_title(ax, title, loc, **kwargs): from matplotlib.offsetbox import AnchoredText fro...
stable__gallery__axes_grid1__demo_axes_grid2
0
figure_000.png
Axes Grid2 — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axes_grid1/demo_axes_grid2.html#sphx-glr-download-gallery-axes-grid1-demo-axes-grid2-py
https://matplotlib.org/stable/_downloads/5fc19bc53f353b5d6f24bdca17a4c140/demo_axes_grid2.py
demo_axes_grid2.py
axes_grid1
ok
1
null
""" ================================ HBoxDivider and VBoxDivider demo ================================ Using an `.HBoxDivider` to arrange subplots. Note that both Axes' location are adjusted so that they have equal heights while maintaining their aspect ratios. """ import matplotlib.pyplot as plt import numpy as np...
stable__gallery__axes_grid1__demo_axes_hbox_divider
0
figure_000.png
HBoxDivider and VBoxDivider demo — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axes_grid1/demo_axes_hbox_divider.html#sphx-glr-download-gallery-axes-grid1-demo-axes-hbox-divider-py
https://matplotlib.org/stable/_downloads/d068f88cea39314c1b79c61e63f18720/demo_axes_hbox_divider.py
demo_axes_hbox_divider.py
axes_grid1
ok
2
null
""" =============================== Show RGB channels using RGBAxes =============================== `~.axes_grid1.axes_rgb.RGBAxes` creates a layout of 4 Axes for displaying RGB channels: one large Axes for the RGB image and 3 smaller Axes for the R, G, B channels. """ import matplotlib.pyplot as plt import numpy as ...
stable__gallery__axes_grid1__demo_axes_rgb
0
figure_000.png
Show RGB channels using RGBAxes — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axes_grid1/demo_axes_rgb.html#sphx-glr-download-gallery-axes-grid1-demo-axes-rgb-py
https://matplotlib.org/stable/_downloads/d4f8e826c13bbb870ffee065e8625f5d/demo_axes_rgb.py
demo_axes_rgb.py
axes_grid1
ok
2
null
""" =============================== Show RGB channels using RGBAxes =============================== `~.axes_grid1.axes_rgb.RGBAxes` creates a layout of 4 Axes for displaying RGB channels: one large Axes for the RGB image and 3 smaller Axes for the R, G, B channels. """ import matplotlib.pyplot as plt import numpy as ...
stable__gallery__axes_grid1__demo_axes_rgb
1
figure_001.png
Show RGB channels using RGBAxes — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axes_grid1/demo_axes_rgb.html#sphx-glr-download-gallery-axes-grid1-demo-axes-rgb-py
https://matplotlib.org/stable/_downloads/d4f8e826c13bbb870ffee065e8625f5d/demo_axes_rgb.py
demo_axes_rgb.py
axes_grid1
ok
2
null
""" .. _demo-colorbar-with-axes-divider: ========================= Colorbar with AxesDivider ========================= The `.axes_divider.make_axes_locatable` function takes an existing Axes, adds it to a new `.AxesDivider` and returns the `.AxesDivider`. The `.append_axes` method of the `.AxesDivider` can then be u...
stable__gallery__axes_grid1__demo_colorbar_with_axes_divider
0
figure_000.png
Colorbar with AxesDivider — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axes_grid1/demo_colorbar_with_axes_divider.html#sphx-glr-download-gallery-axes-grid1-demo-colorbar-with-axes-divider-py
https://matplotlib.org/stable/_downloads/cec7ab65767ff5217c21ae213755cda8/demo_colorbar_with_axes_divider.py
demo_colorbar_with_axes_divider.py
axes_grid1
ok
1
null
""" .. _demo-colorbar-with-inset-locator: =========================================================== Control the position and size of a colorbar with Inset Axes =========================================================== This example shows how to control the position, height, and width of colorbars using `~mpl_toolk...
stable__gallery__axes_grid1__demo_colorbar_with_inset_locator
0
figure_000.png
Control the position and size of a colorbar with Inset Axes — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axes_grid1/demo_colorbar_with_inset_locator.html#sphx-glr-download-gallery-axes-grid1-demo-colorbar-with-inset-locator-py
https://matplotlib.org/stable/_downloads/fef8ebea91f3e2d936a0356c1b573cd8/demo_colorbar_with_inset_locator.py
demo_colorbar_with_inset_locator.py
axes_grid1
ok
1
null
""" =============================== Per-row or per-column colorbars =============================== This example shows how to use one common colorbar for each row or column of an image grid. """ import matplotlib.pyplot as plt from matplotlib import cbook from mpl_toolkits.axes_grid1 import AxesGrid def get_demo_i...
stable__gallery__axes_grid1__demo_edge_colorbar
0
figure_000.png
Per-row or per-column colorbars — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axes_grid1/demo_edge_colorbar.html#sphx-glr-download-gallery-axes-grid1-demo-edge-colorbar-py
https://matplotlib.org/stable/_downloads/c58f7f66a7206520d8eef2c5a8a20d72/demo_edge_colorbar.py
demo_edge_colorbar.py
axes_grid1
ok
1
null
""" =============================== Axes with a fixed physical size =============================== Note that this can be accomplished with the main library for Axes on Figures that do not change size: :ref:`fixed_size_axes` """ import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import Divider, Size # %% ...
stable__gallery__axes_grid1__demo_fixed_size_axes
0
figure_000.png
Axes with a fixed physical size — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axes_grid1/demo_fixed_size_axes.html#sphx-glr-download-gallery-axes-grid1-demo-fixed-size-axes-py
https://matplotlib.org/stable/_downloads/88a68d33e6dc95f3756002ca22961251/demo_fixed_size_axes.py
demo_fixed_size_axes.py
axes_grid1
ok
2
null
""" =============================== Axes with a fixed physical size =============================== Note that this can be accomplished with the main library for Axes on Figures that do not change size: :ref:`fixed_size_axes` """ import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import Divider, Size # %% ...
stable__gallery__axes_grid1__demo_fixed_size_axes
1
figure_001.png
Axes with a fixed physical size — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axes_grid1/demo_fixed_size_axes.html#sphx-glr-download-gallery-axes-grid1-demo-fixed-size-axes-py
https://matplotlib.org/stable/_downloads/88a68d33e6dc95f3756002ca22961251/demo_fixed_size_axes.py
demo_fixed_size_axes.py
axes_grid1
ok
2
null
""" ========================================= ImageGrid cells with a fixed aspect ratio ========================================= """ import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import ImageGrid fig = plt.figure() grid1 = ImageGrid(fig, 121, (2, 2), axes_pad=0.1, aspect=True, shar...
stable__gallery__axes_grid1__demo_imagegrid_aspect
0
figure_000.png
ImageGrid cells with a fixed aspect ratio — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axes_grid1/demo_imagegrid_aspect.html#sphx-glr-download-gallery-axes-grid1-demo-imagegrid-aspect-py
https://matplotlib.org/stable/_downloads/833e25177c1678266fcda4fb016bbcd7/demo_imagegrid_aspect.py
demo_imagegrid_aspect.py
axes_grid1
ok
1
null
""" ================== Inset locator demo ================== """ # %% # The `.inset_locator`'s `~.inset_locator.inset_axes` allows # easily placing insets in the corners of the Axes by specifying a width and # height and optionally a location (loc) that accepts locations as codes, # similar to `~matplotlib.axes.Axes....
stable__gallery__axes_grid1__inset_locator_demo
0
figure_000.png
Inset locator demo — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axes_grid1/inset_locator_demo.html#sphx-glr-download-gallery-axes-grid1-inset-locator-demo-py
https://matplotlib.org/stable/_downloads/f8248729044d7fef8f20a43731251e38/inset_locator_demo.py
inset_locator_demo.py
axes_grid1
ok
3
null
""" ==================== Inset locator demo 2 ==================== This demo shows how to create a zoomed inset via `.zoomed_inset_axes`. In the first subplot an `.AnchoredSizeBar` shows the zoom effect. In the second subplot a connection to the region of interest is created via `.mark_inset`. A version of the second...
stable__gallery__axes_grid1__inset_locator_demo2
0
figure_000.png
Inset locator demo 2 — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axes_grid1/inset_locator_demo2.html#sphx-glr-download-gallery-axes-grid1-inset-locator-demo2-py
https://matplotlib.org/stable/_downloads/ffced02a69365d873f495b7cd6725498/inset_locator_demo2.py
inset_locator_demo2.py
axes_grid1
ok
1
null
""" =============== Parasite Simple =============== """ import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import host_subplot host = host_subplot(111) par = host.twinx() host.set_xlabel("Distance") host.set_ylabel("Density") par.set_ylabel("Temperature") p1, = host.plot([0, 1, 2], [0, 1, 2], label="Dens...
stable__gallery__axes_grid1__parasite_simple
0
figure_000.png
Parasite Simple — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axes_grid1/parasite_simple.html#sphx-glr-download-gallery-axes-grid1-parasite-simple-py
https://matplotlib.org/stable/_downloads/88ad12e90a4c8c93f13b433c0f9c244f/parasite_simple.py
parasite_simple.py
axes_grid1
ok
1
null
""" ================ Parasite Simple2 ================ """ import matplotlib.pyplot as plt import matplotlib.transforms as mtransforms from mpl_toolkits.axes_grid1.parasite_axes import HostAxes obs = [["01_S1", 3.88, 0.14, 1970, 63], ["01_S4", 5.6, 0.82, 1622, 150], ["02_S1", 2.4, 0.54, 1570, 40], ...
stable__gallery__axes_grid1__parasite_simple2
0
figure_000.png
Parasite Simple2 — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axes_grid1/parasite_simple2.html#sphx-glr-download-gallery-axes-grid1-parasite-simple2-py
https://matplotlib.org/stable/_downloads/7cde5ea64c654f0494cddafd39449630/parasite_simple2.py
parasite_simple2.py
axes_grid1
ok
1
null
""" ==================================================== Align histogram to scatter plot using locatable Axes ==================================================== Show the marginal distributions of a scatter plot as histograms at the sides of the plot. For a nice alignment of the main Axes with the marginals, the Axe...
stable__gallery__axes_grid1__scatter_hist_locatable_axes
0
figure_000.png
Align histogram to scatter plot using locatable Axes — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axes_grid1/scatter_hist_locatable_axes.html#sphx-glr-download-gallery-axes-grid1-scatter-hist-locatable-axes-py
https://matplotlib.org/stable/_downloads/51e912a5cf217f8c6647ebf9f5539d38/scatter_hist_locatable_axes.py
scatter_hist_locatable_axes.py
axes_grid1
ok
1
null
""" ======================= Simple Anchored Artists ======================= This example illustrates the use of the anchored helper classes found in :mod:`matplotlib.offsetbox` and in :mod:`mpl_toolkits.axes_grid1`. An implementation of a similar figure, but without use of the toolkit, can be found in :doc:`/gallery/m...
stable__gallery__axes_grid1__simple_anchored_artists
0
figure_000.png
Simple Anchored Artists — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axes_grid1/simple_anchored_artists.html#sphx-glr-download-gallery-axes-grid1-simple-anchored-artists-py
https://matplotlib.org/stable/_downloads/7aa510be32a5c72df8a01d67a5890deb/simple_anchored_artists.py
simple_anchored_artists.py
axes_grid1
ok
1
null
""" ===================== Simple Axes Divider 1 ===================== See also :ref:`axes_grid`. """ import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import Divider, Size def label_axes(ax, text): """Place a label at the center of an Axes, and remove the axis ticks.""" ax.text(.5, .5, text, tra...
stable__gallery__axes_grid1__simple_axes_divider1
0
figure_000.png
Simple Axes Divider 1 — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axes_grid1/simple_axes_divider1.html#sphx-glr-download-gallery-axes-grid1-simple-axes-divider1-py
https://matplotlib.org/stable/_downloads/43ee01b4b62cb46e1521f86c6de1a0a4/simple_axes_divider1.py
simple_axes_divider1.py
axes_grid1
ok
2
null
""" ===================== Simple Axes Divider 1 ===================== See also :ref:`axes_grid`. """ import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import Divider, Size def label_axes(ax, text): """Place a label at the center of an Axes, and remove the axis ticks.""" ax.text(.5, .5, text, tra...
stable__gallery__axes_grid1__simple_axes_divider1
1
figure_001.png
Simple Axes Divider 1 — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axes_grid1/simple_axes_divider1.html#sphx-glr-download-gallery-axes-grid1-simple-axes-divider1-py
https://matplotlib.org/stable/_downloads/43ee01b4b62cb46e1521f86c6de1a0a4/simple_axes_divider1.py
simple_axes_divider1.py
axes_grid1
ok
2
null
""" ===================== Simple axes divider 3 ===================== See also :ref:`axes_grid`. """ import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import Divider import mpl_toolkits.axes_grid1.axes_size as Size fig = plt.figure(figsize=(5.5, 4)) # the rect parameter will be ignored as we will set ax...
stable__gallery__axes_grid1__simple_axes_divider3
0
figure_000.png
Simple axes divider 3 — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axes_grid1/simple_axes_divider3.html#sphx-glr-download-gallery-axes-grid1-simple-axes-divider3-py
https://matplotlib.org/stable/_downloads/bb0580289006b321b47cf070fd5c1bfb/simple_axes_divider3.py
simple_axes_divider3.py
axes_grid1
ok
1
null
""" ================ Simple ImageGrid ================ Align multiple images using `~mpl_toolkits.axes_grid1.axes_grid.ImageGrid`. """ import matplotlib.pyplot as plt import numpy as np from mpl_toolkits.axes_grid1 import ImageGrid im1 = np.arange(100).reshape((10, 10)) im2 = im1.T im3 = np.flipud(im1) im4 = np.fli...
stable__gallery__axes_grid1__simple_axesgrid
0
figure_000.png
Simple ImageGrid — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axes_grid1/simple_axesgrid.html#sphx-glr-download-gallery-axes-grid1-simple-axesgrid-py
https://matplotlib.org/stable/_downloads/c28e31130cca60f0a4ac710f3fbf96c8/simple_axesgrid.py
simple_axesgrid.py
axes_grid1
ok
1
null
""" ================== Simple ImageGrid 2 ================== Align multiple images of different sizes using `~mpl_toolkits.axes_grid1.axes_grid.ImageGrid`. """ import matplotlib.pyplot as plt from matplotlib import cbook from mpl_toolkits.axes_grid1 import ImageGrid fig = plt.figure(figsize=(5.5, 3.5)) grid = Image...
stable__gallery__axes_grid1__simple_axesgrid2
0
figure_000.png
Simple ImageGrid 2 — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axes_grid1/simple_axesgrid2.html#sphx-glr-download-gallery-axes-grid1-simple-axesgrid2-py
https://matplotlib.org/stable/_downloads/a6da60ccaa4eeba18fd39bf89cef94aa/simple_axesgrid2.py
simple_axesgrid2.py
axes_grid1
ok
1
null
""" ================ Simple Axisline4 ================ """ import matplotlib.pyplot as plt import numpy as np from mpl_toolkits.axes_grid1 import host_subplot ax = host_subplot(111) xx = np.arange(0, 2*np.pi, 0.01) ax.plot(xx, np.sin(xx)) ax2 = ax.twin() # ax2 is responsible for "top" axis and "right" axis ax2.set...
stable__gallery__axes_grid1__simple_axisline4
0
figure_000.png
Simple Axisline4 — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axes_grid1/simple_axisline4.html#sphx-glr-download-gallery-axes-grid1-simple-axisline4-py
https://matplotlib.org/stable/_downloads/416437b16432ec060b1f3910fdfe5d78/simple_axisline4.py
simple_axisline4.py
axes_grid1
ok
1
null
""" ============== Axis Direction ============== """ import matplotlib.pyplot as plt import mpl_toolkits.axisartist as axisartist def setup_axes(fig, pos): ax = fig.add_subplot(pos, axes_class=axisartist.Axes) ax.set_ylim(-0.1, 1.5) ax.set_yticks([0, 1]) ax.axis[:].set_visible(False) ax.axis[...
stable__gallery__axisartist__axis_direction
0
figure_000.png
Axis Direction — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axisartist/axis_direction.html#sphx-glr-download-gallery-axisartist-axis-direction-py
https://matplotlib.org/stable/_downloads/3d8125065415e7722e62573de9ae1073/axis_direction.py
axis_direction.py
axisartist
ok
1
null
""" =================== axis_direction demo =================== """ import matplotlib.pyplot as plt import numpy as np from matplotlib.projections import PolarAxes from matplotlib.transforms import Affine2D import mpl_toolkits.axisartist as axisartist import mpl_toolkits.axisartist.angle_helper as angle_helper import...
stable__gallery__axisartist__demo_axis_direction
0
figure_000.png
axis_direction demo — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axisartist/demo_axis_direction.html#sphx-glr-download-gallery-axisartist-demo-axis-direction-py
https://matplotlib.org/stable/_downloads/a209d398996b5e5fa1542119df3c251c/demo_axis_direction.py
demo_axis_direction.py
axisartist
ok
1
null
""" ================ Axis line styles ================ This example shows some configurations for axis style. Note: The `mpl_toolkits.axisartist` Axes classes may be confusing for new users. If the only aim is to obtain arrow heads at the ends of the axes, rather check out the :doc:`/gallery/spines/centered_spines_wi...
stable__gallery__axisartist__demo_axisline_style
0
figure_000.png
Axis line styles — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axisartist/demo_axisline_style.html#sphx-glr-download-gallery-axisartist-demo-axisline-style-py
https://matplotlib.org/stable/_downloads/2efbf158321b6ee9b59fa6e4e5367de6/demo_axisline_style.py
demo_axisline_style.py
axisartist
ok
1
null
""" ===================== Curvilinear grid demo ===================== Custom grid and ticklines. This example demonstrates how to use `~.grid_helper_curvelinear.GridHelperCurveLinear` to define custom grids and ticklines by applying a transformation on the grid. This can be used, as shown on the second plot, to crea...
stable__gallery__axisartist__demo_curvelinear_grid
0
figure_000.png
Curvilinear grid demo — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axisartist/demo_curvelinear_grid.html#sphx-glr-download-gallery-axisartist-demo-curvelinear-grid-py
https://matplotlib.org/stable/_downloads/0dff3dd67468123eb00b27dd85176840/demo_curvelinear_grid.py
demo_curvelinear_grid.py
axisartist
ok
1
null
""" ====================== Demo CurveLinear Grid2 ====================== Custom grid and ticklines. This example demonstrates how to use GridHelperCurveLinear to define custom grids and ticklines by applying a transformation on the grid. As showcase on the plot, a 5x5 matrix is displayed on the Axes. """ import matp...
stable__gallery__axisartist__demo_curvelinear_grid2
0
figure_000.png
Demo CurveLinear Grid2 — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axisartist/demo_curvelinear_grid2.html#sphx-glr-download-gallery-axisartist-demo-curvelinear-grid2-py
https://matplotlib.org/stable/_downloads/0466e9045f8fe3100f98c2a3b536994c/demo_curvelinear_grid2.py
demo_curvelinear_grid2.py
axisartist
ok
1
null
""" ========================== ``floating_axes`` features ========================== Demonstration of features of the :mod:`.floating_axes` module: * Using `~.axes.Axes.scatter` and `~.axes.Axes.bar` with changing the shape of the plot. * Using `~.floating_axes.GridHelperCurveLinear` to rotate the plot and set the ...
stable__gallery__axisartist__demo_floating_axes
0
figure_000.png
floating_axes features — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axisartist/demo_floating_axes.html#sphx-glr-download-gallery-axisartist-demo-floating-axes-py
https://matplotlib.org/stable/_downloads/c53046419d84d1eb912e1ce17dcc1789/demo_floating_axes.py
demo_floating_axes.py
axisartist
ok
1
null
""" ================== floating_axis demo ================== Axis within rectangular frame. The following code demonstrates how to put a floating polar curve within a rectangular box. In order to get a better sense of polar curves, please look at :doc:`/gallery/axisartist/demo_curvelinear_grid`. """ import matplotli...
stable__gallery__axisartist__demo_floating_axis
0
figure_000.png
floating_axis demo — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axisartist/demo_floating_axis.html#sphx-glr-download-gallery-axisartist-demo-floating-axis-py
https://matplotlib.org/stable/_downloads/12927e05bde893cbae7f16aaed1b87eb/demo_floating_axis.py
demo_floating_axis.py
axisartist
ok
1
null
""" ================== Parasite Axes demo ================== Create a parasite Axes. Such Axes would share the x scale with a host Axes, but show a different scale in y direction. This approach uses `mpl_toolkits.axes_grid1.parasite_axes.HostAxes` and `mpl_toolkits.axes_grid1.parasite_axes.ParasiteAxes`. The standar...
stable__gallery__axisartist__demo_parasite_axes
0
figure_000.png
Parasite Axes demo — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axisartist/demo_parasite_axes.html#sphx-glr-download-gallery-axisartist-demo-parasite-axes-py
https://matplotlib.org/stable/_downloads/5922b9d93b49d592301af79dfdddf7de/demo_parasite_axes.py
demo_parasite_axes.py
axisartist
ok
1
null
""" ================== Parasite axis demo ================== This example demonstrates the use of parasite axis to plot multiple datasets onto one single plot. Notice how in this example, *par1* and *par2* are both obtained by calling ``twinx()``, which ties their x-limits with the host's x-axis. From there, each of ...
stable__gallery__axisartist__demo_parasite_axes2
0
figure_000.png
Parasite axis demo — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axisartist/demo_parasite_axes2.html#sphx-glr-download-gallery-axisartist-demo-parasite-axes2-py
https://matplotlib.org/stable/_downloads/07a9488814cca10d5122c0c5527bcaaf/demo_parasite_axes2.py
demo_parasite_axes2.py
axisartist
ok
1
null
""" =================== Ticklabel alignment =================== """ import matplotlib.pyplot as plt import mpl_toolkits.axisartist as axisartist def setup_axes(fig, pos): ax = fig.add_subplot(pos, axes_class=axisartist.Axes) ax.set_yticks([0.2, 0.8], labels=["short", "loooong"]) ax.set_xticks([0.2, 0....
stable__gallery__axisartist__demo_ticklabel_alignment
0
figure_000.png
Ticklabel alignment — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axisartist/demo_ticklabel_alignment.html#ticklabel-alignment
https://matplotlib.org/stable/_downloads/10139578672ab6e375bdd67b9504f4d6/demo_ticklabel_alignment.py
demo_ticklabel_alignment.py
axisartist
ok
1
null
""" =================== Ticklabel direction =================== """ import matplotlib.pyplot as plt import mpl_toolkits.axisartist.axislines as axislines def setup_axes(fig, pos): ax = fig.add_subplot(pos, axes_class=axislines.Axes) ax.set_yticks([0.2, 0.8]) ax.set_xticks([0.2, 0.8]) return ax fi...
stable__gallery__axisartist__demo_ticklabel_direction
0
figure_000.png
Ticklabel direction — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axisartist/demo_ticklabel_direction.html#ticklabel-direction
https://matplotlib.org/stable/_downloads/aa167433a0ccdf23a207687a44a29246/demo_ticklabel_direction.py
demo_ticklabel_direction.py
axisartist
ok
1
null
""" ===================== Simple axis direction ===================== """ import matplotlib.pyplot as plt import mpl_toolkits.axisartist as axisartist fig = plt.figure(figsize=(4, 2.5)) ax1 = fig.add_subplot(axes_class=axisartist.Axes) fig.subplots_adjust(right=0.8) ax1.axis["left"].major_ticklabels.set_axis_direct...
stable__gallery__axisartist__simple_axis_direction01
0
figure_000.png
Simple axis direction — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axisartist/simple_axis_direction01.html#sphx-glr-download-gallery-axisartist-simple-axis-direction01-py
https://matplotlib.org/stable/_downloads/3b445f30fa702ff55f1547368707c820/simple_axis_direction01.py
simple_axis_direction01.py
axisartist
ok
1
null
""" ========================================== Simple axis tick label and tick directions ========================================== First subplot moves the tick labels to inside the spines. Second subplot moves the ticks to inside the spines. These effects can be obtained for a standard Axes by `~.Axes.tick_params`. ...
stable__gallery__axisartist__simple_axis_direction03
0
figure_000.png
Simple axis tick label and tick directions — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axisartist/simple_axis_direction03.html#sphx-glr-download-gallery-axisartist-simple-axis-direction03-py
https://matplotlib.org/stable/_downloads/1841cf2985a8e908a9488d1cfc5e6ba3/simple_axis_direction03.py
simple_axis_direction03.py
axisartist
ok
1
null
""" =============== Simple axis pad =============== """ import matplotlib.pyplot as plt import numpy as np from matplotlib.projections import PolarAxes from matplotlib.transforms import Affine2D import mpl_toolkits.axisartist as axisartist import mpl_toolkits.axisartist.angle_helper as angle_helper import mpl_toolki...
stable__gallery__axisartist__simple_axis_pad
0
figure_000.png
Simple axis pad — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axisartist/simple_axis_pad.html#sphx-glr-download-gallery-axisartist-simple-axis-pad-py
https://matplotlib.org/stable/_downloads/6a991ef2680010dc3e315bc57b8de102/simple_axis_pad.py
simple_axis_pad.py
axisartist
ok
1
null
""" ============================= Custom spines with axisartist ============================= This example showcases the use of :mod:`.axisartist` to draw spines at custom positions (here, at ``y = 0``). Note, however, that it is simpler to achieve this effect using standard `.Spine` methods, as demonstrated in :doc:...
stable__gallery__axisartist__simple_axisartist1
0
figure_000.png
Custom spines with axisartist — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axisartist/simple_axisartist1.html#sphx-glr-download-gallery-axisartist-simple-axisartist1-py
https://matplotlib.org/stable/_downloads/172bea947b5b7014a1272376e04e4e51/simple_axisartist1.py
simple_axisartist1.py
axisartist
ok
1
null
""" =============== Simple Axisline =============== """ import matplotlib.pyplot as plt from mpl_toolkits.axisartist.axislines import AxesZero fig = plt.figure() fig.subplots_adjust(right=0.85) ax = fig.add_subplot(axes_class=AxesZero) # make right and top axis invisible ax.axis["right"].set_visible(False) ax.axis...
stable__gallery__axisartist__simple_axisline
0
figure_000.png
Simple Axisline — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axisartist/simple_axisline.html#sphx-glr-download-gallery-axisartist-simple-axisline-py
https://matplotlib.org/stable/_downloads/bb682f022912692f490c5c3e20e0b35b/simple_axisline.py
simple_axisline.py
axisartist
ok
1
null
""" ================ Simple Axisline3 ================ """ import matplotlib.pyplot as plt from mpl_toolkits.axisartist.axislines import Axes fig = plt.figure(figsize=(3, 3)) ax = fig.add_subplot(axes_class=Axes) ax.axis["right"].set_visible(False) ax.axis["top"].set_visible(False) plt.show()
stable__gallery__axisartist__simple_axisline3
0
figure_000.png
Simple Axisline3 — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/axisartist/simple_axisline3.html#sphx-glr-download-gallery-axisartist-simple-axisline3-py
https://matplotlib.org/stable/_downloads/364e7f571a4fb87e2fc9de904066c64a/simple_axisline3.py
simple_axisline3.py
axisartist
ok
1
null
""" ================ Color by y-value ================ Use masked arrays to plot a line with different colors by y-value. """ import matplotlib.pyplot as plt import numpy as np t = np.arange(0.0, 2.0, 0.01) s = np.sin(2 * np.pi * t) upper = 0.77 lower = -0.77 supper = np.ma.masked_where(s < upper, s) slower = np.ma...
stable__gallery__color__color_by_yvalue
0
figure_000.png
Color by y-value — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/color/color_by_yvalue.html#sphx-glr-download-gallery-color-color-by-yvalue-py
https://matplotlib.org/stable/_downloads/03190594ca1f6702e35730d7e22745c5/color_by_yvalue.py
color_by_yvalue.py
color
ok
1
null
""" ==================================== Colors in the default property cycle ==================================== Display the colors from the default prop_cycle, which is obtained from the :ref:`rc parameters<customizing>`. """ import matplotlib.pyplot as plt import numpy as np from matplotlib.colors import TABLEAU_...
stable__gallery__color__color_cycle_default
0
figure_000.png
Colors in the default property cycle — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/color/color_cycle_default.html#sphx-glr-download-gallery-color-color-cycle-default-py
https://matplotlib.org/stable/_downloads/233af54bee28814ae4bb34817226f0ea/color_cycle_default.py
color_cycle_default.py
color
ok
1
null
""" ========== Color Demo ========== Matplotlib recognizes the following formats to specify a color: 1) an RGB or RGBA tuple of float values in ``[0, 1]`` (e.g. ``(0.1, 0.2, 0.5)`` or ``(0.1, 0.2, 0.5, 0.3)``). RGBA is short for Red, Green, Blue, Alpha; 2) a hex RGB or RGBA string (e.g., ``'#0F0F0F'`` or ``'#0F0F...
stable__gallery__color__color_demo
0
figure_000.png
Color Demo — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/color/color_demo.html#sphx-glr-download-gallery-color-color-demo-py
https://matplotlib.org/stable/_downloads/0622457b6b860061b937fd5f8d899da8/color_demo.py
color_demo.py
color
ok
1
null
""" ===================== Named color sequences ===================== Matplotlib's `~matplotlib.colors.ColorSequenceRegistry` allows access to predefined lists of colors by name e.g. ``colors = matplotlib.color_sequences['Set1']``. This example shows all of the built in color sequences. User-defined sequences can be...
stable__gallery__color__color_sequences
0
figure_000.png
Named color sequences — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/color/color_sequences.html#sphx-glr-download-gallery-color-color-sequences-py
https://matplotlib.org/stable/_downloads/9e70d40e9d045adb66bdd483958508f2/color_sequences.py
color_sequences.py
color
ok
1
null
""" ======== Colorbar ======== Use `~.Figure.colorbar` by specifying the mappable object (here the `.AxesImage` returned by `~.axes.Axes.imshow`) and the Axes to attach the colorbar to. """ import matplotlib.pyplot as plt import numpy as np # setup some generic data N = 37 x, y = np.mgrid[:N, :N] Z = (np.cos(x*0.2) ...
stable__gallery__color__colorbar_basics
0
figure_000.png
Colorbar — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/color/colorbar_basics.html#sphx-glr-download-gallery-color-colorbar-basics-py
https://matplotlib.org/stable/_downloads/642498711ab58d6f80ef376a375dda14/colorbar_basics.py
colorbar_basics.py
color
ok
1
null
""" ================== Colormap reference ================== Reference for colormaps included with Matplotlib. A reversed version of each of these colormaps is available by appending ``_r`` to the name, as shown in :ref:`reverse-cmap`. See :ref:`colormaps` for an in-depth discussion about colormaps, including colorb...
stable__gallery__color__colormap_reference
0
figure_000.png
Colormap reference — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/color/colormap_reference.html#sphx-glr-download-gallery-color-colormap-reference-py
https://matplotlib.org/stable/_downloads/dd314a83577f446493e34d27a1ed8451/colormap_reference.py
colormap_reference.py
color
ok
8
null
""" ================== Colormap reference ================== Reference for colormaps included with Matplotlib. A reversed version of each of these colormaps is available by appending ``_r`` to the name, as shown in :ref:`reverse-cmap`. See :ref:`colormaps` for an in-depth discussion about colormaps, including colorb...
stable__gallery__color__colormap_reference
1
figure_001.png
Colormap reference — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/color/colormap_reference.html#sphx-glr-download-gallery-color-colormap-reference-py
https://matplotlib.org/stable/_downloads/dd314a83577f446493e34d27a1ed8451/colormap_reference.py
colormap_reference.py
color
ok
8
null
""" ================== Colormap reference ================== Reference for colormaps included with Matplotlib. A reversed version of each of these colormaps is available by appending ``_r`` to the name, as shown in :ref:`reverse-cmap`. See :ref:`colormaps` for an in-depth discussion about colormaps, including colorb...
stable__gallery__color__colormap_reference
2
figure_002.png
Colormap reference — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/color/colormap_reference.html#sphx-glr-download-gallery-color-colormap-reference-py
https://matplotlib.org/stable/_downloads/dd314a83577f446493e34d27a1ed8451/colormap_reference.py
colormap_reference.py
color
ok
8
null
""" ================== Colormap reference ================== Reference for colormaps included with Matplotlib. A reversed version of each of these colormaps is available by appending ``_r`` to the name, as shown in :ref:`reverse-cmap`. See :ref:`colormaps` for an in-depth discussion about colormaps, including colorb...
stable__gallery__color__colormap_reference
3
figure_003.png
Colormap reference — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/color/colormap_reference.html#sphx-glr-download-gallery-color-colormap-reference-py
https://matplotlib.org/stable/_downloads/dd314a83577f446493e34d27a1ed8451/colormap_reference.py
colormap_reference.py
color
ok
8
null
""" ================== Colormap reference ================== Reference for colormaps included with Matplotlib. A reversed version of each of these colormaps is available by appending ``_r`` to the name, as shown in :ref:`reverse-cmap`. See :ref:`colormaps` for an in-depth discussion about colormaps, including colorb...
stable__gallery__color__colormap_reference
4
figure_004.png
Colormap reference — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/color/colormap_reference.html#sphx-glr-download-gallery-color-colormap-reference-py
https://matplotlib.org/stable/_downloads/dd314a83577f446493e34d27a1ed8451/colormap_reference.py
colormap_reference.py
color
ok
8
null
""" ================== Colormap reference ================== Reference for colormaps included with Matplotlib. A reversed version of each of these colormaps is available by appending ``_r`` to the name, as shown in :ref:`reverse-cmap`. See :ref:`colormaps` for an in-depth discussion about colormaps, including colorb...
stable__gallery__color__colormap_reference
5
figure_005.png
Colormap reference — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/color/colormap_reference.html#sphx-glr-download-gallery-color-colormap-reference-py
https://matplotlib.org/stable/_downloads/dd314a83577f446493e34d27a1ed8451/colormap_reference.py
colormap_reference.py
color
ok
8
null
""" ================== Colormap reference ================== Reference for colormaps included with Matplotlib. A reversed version of each of these colormaps is available by appending ``_r`` to the name, as shown in :ref:`reverse-cmap`. See :ref:`colormaps` for an in-depth discussion about colormaps, including colorb...
stable__gallery__color__colormap_reference
6
figure_006.png
Colormap reference — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/color/colormap_reference.html#sphx-glr-download-gallery-color-colormap-reference-py
https://matplotlib.org/stable/_downloads/dd314a83577f446493e34d27a1ed8451/colormap_reference.py
colormap_reference.py
color
ok
8
null
""" ================== Colormap reference ================== Reference for colormaps included with Matplotlib. A reversed version of each of these colormaps is available by appending ``_r`` to the name, as shown in :ref:`reverse-cmap`. See :ref:`colormaps` for an in-depth discussion about colormaps, including colorb...
stable__gallery__color__colormap_reference
7
figure_007.png
Colormap reference — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/color/colormap_reference.html#sphx-glr-download-gallery-color-colormap-reference-py
https://matplotlib.org/stable/_downloads/dd314a83577f446493e34d27a1ed8451/colormap_reference.py
colormap_reference.py
color
ok
8
null
""" ======================================= Create a colormap from a list of colors ======================================= For more detail on creating and manipulating colormaps see :ref:`colormap-manipulation`. Creating a :ref:`colormap <colormaps>` from a list of colors can be done with the `.LinearSegmentedColorm...
stable__gallery__color__custom_cmap
0
figure_000.png
Create a colormap from a list of colors — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/color/custom_cmap.html#sphx-glr-download-gallery-color-custom-cmap-py
https://matplotlib.org/stable/_downloads/fba15be770735fdb1b9272eaaf80104e/custom_cmap.py
custom_cmap.py
color
ok
2
null
""" ======================================= Create a colormap from a list of colors ======================================= For more detail on creating and manipulating colormaps see :ref:`colormap-manipulation`. Creating a :ref:`colormap <colormaps>` from a list of colors can be done with the `.LinearSegmentedColorm...
stable__gallery__color__custom_cmap
1
figure_001.png
Create a colormap from a list of colors — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/color/custom_cmap.html#sphx-glr-download-gallery-color-custom-cmap-py
https://matplotlib.org/stable/_downloads/fba15be770735fdb1b9272eaaf80104e/custom_cmap.py
custom_cmap.py
color
ok
2
null
""" =========================================== Selecting individual colors from a colormap =========================================== Sometimes we want to use more colors or a different set of colors than the default color cycle provides. Selecting individual colors from one of the provided colormaps can be a conven...
stable__gallery__color__individual_colors_from_cmap
0
figure_000.png
Selecting individual colors from a colormap — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/color/individual_colors_from_cmap.html#sphx-glr-download-gallery-color-individual-colors-from-cmap-py
https://matplotlib.org/stable/_downloads/b1c9924f6057db5fd639115816c61470/individual_colors_from_cmap.py
individual_colors_from_cmap.py
color
ok
2
null
""" ==================== List of named colors ==================== This plots a list of the named colors supported by Matplotlib. For more information on colors in matplotlib see * the :ref:`colors_def` tutorial; * the `matplotlib.colors` API; * the :doc:`/gallery/color/color_demo`. ---------------------------- Help...
stable__gallery__color__named_colors
0
figure_000.png
List of named colors — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/color/named_colors.html#xkcd-colors
https://matplotlib.org/stable/_downloads/861cf0b07b083f3c44ddd625a0e99000/named_colors.py
named_colors.py
color
ok
3
null
""" ==================== List of named colors ==================== This plots a list of the named colors supported by Matplotlib. For more information on colors in matplotlib see * the :ref:`colors_def` tutorial; * the `matplotlib.colors` API; * the :doc:`/gallery/color/color_demo`. ---------------------------- Help...
stable__gallery__color__named_colors
1
figure_001.png
List of named colors — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/color/named_colors.html#xkcd-colors
https://matplotlib.org/stable/_downloads/861cf0b07b083f3c44ddd625a0e99000/named_colors.py
named_colors.py
color
ok
3
null
""" ==================== List of named colors ==================== This plots a list of the named colors supported by Matplotlib. For more information on colors in matplotlib see * the :ref:`colors_def` tutorial; * the `matplotlib.colors` API; * the :doc:`/gallery/color/color_demo`. ---------------------------- Help...
stable__gallery__color__named_colors
2
figure_002.png
List of named colors — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/color/named_colors.html#xkcd-colors
https://matplotlib.org/stable/_downloads/861cf0b07b083f3c44ddd625a0e99000/named_colors.py
named_colors.py
color
ok
3
null
""" ================================= Ways to set a color's alpha value ================================= Compare setting alpha by the *alpha* keyword argument and by one of the Matplotlib color formats. Often, the *alpha* keyword is the only tool needed to add transparency to a color. In some cases, the *(matplotlib_...
stable__gallery__color__set_alpha
0
figure_000.png
Ways to set a color's alpha value — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/color/set_alpha.html#ways-to-set-a-color-s-alpha-value
https://matplotlib.org/stable/_downloads/8ac9df75950acff1ebf040a1d2761824/set_alpha.py
set_alpha.py
color
ok
1
null
""" =========== Close event =========== Example to show connecting events that occur when the figure closes. .. note:: This example exercises the interactive capabilities of Matplotlib, and this will not appear in the static documentation. Please run this code on your machine to see the interactivity. ...
stable__gallery__event_handling__close_event
0
figure_000.png
Close event — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/event_handling/close_event.html#sphx-glr-download-gallery-event-handling-close-event-py
https://matplotlib.org/stable/_downloads/2488fa170f211c6d0f8dabb214010122/close_event.py
close_event.py
event_handling
ok
1
null
""" =========================== Mouse move and click events =========================== An example of how to interact with the plotting canvas by connecting to move and click events. .. note:: This example exercises the interactive capabilities of Matplotlib, and this will not appear in the static documentati...
stable__gallery__event_handling__coords_demo
0
figure_000.png
Mouse move and click events — Matplotlib 3.10.8 documentation
https://matplotlib.org/stable/gallery/event_handling/coords_demo.html#sphx-glr-download-gallery-event-handling-coords-demo-py
https://matplotlib.org/stable/_downloads/4153d91592ea2c87ab46a3a29e0530ed/coords_demo.py
coords_demo.py
event_handling
ok
1
null
End of preview. Expand in Data Studio

Matplotlib Code-Image Pairs

Dataset Summary

This dataset contains static Matplotlib figure images paired with the Python source code that generated them. It was built from the official Matplotlib gallery and excludes animation-style examples. Each row corresponds to one rendered image. Examples that produce multiple figures contribute multiple rows.

Dataset Composition

Top Categories

  • lines_bars_and_markers: 48 examples
  • images_contours_and_fields: 47 examples
  • text_labels_and_annotations: 46 examples
  • mplot3d: 44 examples
  • subplots_axes_and_figures: 35 examples
  • misc: 25 examples
  • ticks: 24 examples
  • axes_grid1: 22 examples
  • statistics: 21 examples
  • event_handling: 20 examples

Row Schema

  • image: rendered PNG for one figure
  • code: full Python source for the example
  • example_id: stable identifier derived from the Matplotlib gallery URL
  • figure_index: zero-based figure index within the example
  • figure_name: original rendered image filename
  • title: example page title
  • example_page_url: Matplotlib gallery page URL
  • source_url: downloadable Python source URL when available
  • source_relpath: source filename reported by the scraper
  • category_hint: rough gallery category inferred from the URL path
  • status: scraper/render status kept for provenance
  • num_figures: number of figures reported for the source example
  • error: render or scrape error text, usually null for successful rows

Build Process

  1. Crawl the official Matplotlib gallery.
  2. Download the Python source for each example page.
  3. Render examples with Matplotlib's non-interactive Agg backend.
  4. Keep static rendered image/code pairs and skip dynamic animation-style examples.
  5. Export one dataset row per rendered image.

Usage

Load the local saved dataset:

from datasets import load_from_disk

ds = load_from_disk("/usr/project/xtmp/ap843/hf_datasets/matplotlib_code_image_pairs")["train"]

Load from the Hugging Face Hub after pushing:

from datasets import load_dataset

ds = load_dataset("ajayvikram/matplotlib-code-image", split="train")

License And Attribution

This dataset is derived from Matplotlib gallery examples. The card metadata uses license: other with license_name: matplotlib-license and license_link: https://matplotlib.org/stable/project/license.html because the Matplotlib project uses a project-specific license rather than a standard Hugging Face license identifier. The official Matplotlib license permits use, distribution, and derivative works provided the Matplotlib copyright notice and license agreement are retained. This is an interpretation of the official license page, not legal advice.

Downloads last month
42