:orphan: Code samples for Matplotlib ---------------------------- The examples here are only examples relevant to the points raised in this chapter. The matplotlib documentation comes with a much more exhaustive `gallery `__. .. raw:: html
.. thumbnail-parent-div-open .. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/images/thumb/sphx_glr_plot_pie_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_plot_pie.py` .. raw:: html
Pie chart
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/images/thumb/sphx_glr_plot_good_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_plot_good.py` .. raw:: html
A simple, good-looking plot
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/images/thumb/sphx_glr_plot_scatter_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_plot_scatter.py` .. raw:: html
Plotting a scatter of points
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/images/thumb/sphx_glr_plot_multiplot_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_plot_multiplot.py` .. raw:: html
Subplots
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/images/thumb/sphx_glr_plot_subplot-horizontal_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_plot_subplot-horizontal.py` .. raw:: html
Horizontal arrangement of subplots
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/images/thumb/sphx_glr_plot_bad_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_plot_bad.py` .. raw:: html
A simple plotting example
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/images/thumb/sphx_glr_plot_subplot-vertical_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_plot_subplot-vertical.py` .. raw:: html
Subplot plot arrangement vertical
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/images/thumb/sphx_glr_plot_axes_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_plot_axes.py` .. raw:: html
Simple axes example
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/images/thumb/sphx_glr_plot_plot3d_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_plot_plot3d.py` .. raw:: html
3D plotting
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/images/thumb/sphx_glr_plot_imshow_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_plot_imshow.py` .. raw:: html
Imshow elaborate
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/images/thumb/sphx_glr_plot_quiver_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_plot_quiver.py` .. raw:: html
Plotting a vector field: quiver
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/images/thumb/sphx_glr_plot_contour_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_plot_contour.py` .. raw:: html
Displaying the contours of a function
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/images/thumb/sphx_glr_plot_ugly_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_plot_ugly.py` .. raw:: html
A example of plotting not quite right
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/images/thumb/sphx_glr_plot_plot_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_plot_plot.py` .. raw:: html
Plot and filled plots
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/images/thumb/sphx_glr_plot_polar_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_plot_polar.py` .. raw:: html
Plotting in polar coordinates
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/images/thumb/sphx_glr_plot_bar_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_plot_bar.py` .. raw:: html
Bar plots
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/images/thumb/sphx_glr_plot_subplot-grid_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_plot_subplot-grid.py` .. raw:: html
Subplot grid
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/images/thumb/sphx_glr_plot_axes-2_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_plot_axes-2.py` .. raw:: html
Axes
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/images/thumb/sphx_glr_plot_grid_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_plot_grid.py` .. raw:: html
Grid
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/images/thumb/sphx_glr_plot_plot3d-2_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_plot_plot3d-2.py` .. raw:: html
3D plotting
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/images/thumb/sphx_glr_plot_gridspec_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_plot_gridspec.py` .. raw:: html
GridSpec
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/images/thumb/sphx_glr_plot_text_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_plot_text.py` .. raw:: html
Demo text printing
.. thumbnail-parent-div-close .. raw:: html
.. toctree:: :hidden: /intro/matplotlib/auto_examples/plot_pie /intro/matplotlib/auto_examples/plot_good /intro/matplotlib/auto_examples/plot_scatter /intro/matplotlib/auto_examples/plot_multiplot /intro/matplotlib/auto_examples/plot_subplot-horizontal /intro/matplotlib/auto_examples/plot_bad /intro/matplotlib/auto_examples/plot_subplot-vertical /intro/matplotlib/auto_examples/plot_axes /intro/matplotlib/auto_examples/plot_plot3d /intro/matplotlib/auto_examples/plot_imshow /intro/matplotlib/auto_examples/plot_quiver /intro/matplotlib/auto_examples/plot_contour /intro/matplotlib/auto_examples/plot_ugly /intro/matplotlib/auto_examples/plot_plot /intro/matplotlib/auto_examples/plot_polar /intro/matplotlib/auto_examples/plot_bar /intro/matplotlib/auto_examples/plot_subplot-grid /intro/matplotlib/auto_examples/plot_axes-2 /intro/matplotlib/auto_examples/plot_grid /intro/matplotlib/auto_examples/plot_plot3d-2 /intro/matplotlib/auto_examples/plot_gridspec /intro/matplotlib/auto_examples/plot_text Code for the chapter's exercises -------------------------------- .. raw:: html
.. thumbnail-parent-div-open .. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/exercises/images/thumb/sphx_glr_plot_exercise_1_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_exercises_plot_exercise_1.py` .. raw:: html
Exercise 1
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/exercises/images/thumb/sphx_glr_plot_exercise_4_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_exercises_plot_exercise_4.py` .. raw:: html
Exercise 4
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/exercises/images/thumb/sphx_glr_plot_exercise_3_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_exercises_plot_exercise_3.py` .. raw:: html
Exercise 3
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/exercises/images/thumb/sphx_glr_plot_exercise_5_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_exercises_plot_exercise_5.py` .. raw:: html
Exercise 5
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/exercises/images/thumb/sphx_glr_plot_exercise_6_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_exercises_plot_exercise_6.py` .. raw:: html
Exercise 6
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/exercises/images/thumb/sphx_glr_plot_exercise_2_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_exercises_plot_exercise_2.py` .. raw:: html
Exercise 2
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/exercises/images/thumb/sphx_glr_plot_exercise_7_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_exercises_plot_exercise_7.py` .. raw:: html
Exercise 7
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/exercises/images/thumb/sphx_glr_plot_exercise_8_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_exercises_plot_exercise_8.py` .. raw:: html
Exercise 8
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/exercises/images/thumb/sphx_glr_plot_exercise_9_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_exercises_plot_exercise_9.py` .. raw:: html
Exercise 9
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/exercises/images/thumb/sphx_glr_plot_exercise_10_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_exercises_plot_exercise_10.py` .. raw:: html
Exercise
.. thumbnail-parent-div-close .. raw:: html
Example demoing choices for an option -------------------------------------- .. raw:: html
.. thumbnail-parent-div-open .. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/options/images/thumb/sphx_glr_plot_color_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_options_plot_color.py` .. raw:: html
The colors matplotlib line plots
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/options/images/thumb/sphx_glr_plot_linewidth_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_options_plot_linewidth.py` .. raw:: html
Linewidth
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/options/images/thumb/sphx_glr_plot_alpha_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_options_plot_alpha.py` .. raw:: html
Alpha: transparency
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/options/images/thumb/sphx_glr_plot_aliased_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_options_plot_aliased.py` .. raw:: html
Aliased versus anti-aliased
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/options/images/thumb/sphx_glr_plot_antialiased_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_options_plot_antialiased.py` .. raw:: html
Aliased versus anti-aliased
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/options/images/thumb/sphx_glr_plot_ms_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_options_plot_ms.py` .. raw:: html
Marker size
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/options/images/thumb/sphx_glr_plot_mew_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_options_plot_mew.py` .. raw:: html
Marker edge width
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/options/images/thumb/sphx_glr_plot_colormaps_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_options_plot_colormaps.py` .. raw:: html
Colormaps
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/options/images/thumb/sphx_glr_plot_solid_joinstyle_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_options_plot_solid_joinstyle.py` .. raw:: html
Solid joint style
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/options/images/thumb/sphx_glr_plot_solid_capstyle_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_options_plot_solid_capstyle.py` .. raw:: html
Solid cap style
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/options/images/thumb/sphx_glr_plot_mec_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_options_plot_mec.py` .. raw:: html
Marker edge color
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/options/images/thumb/sphx_glr_plot_mfc_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_options_plot_mfc.py` .. raw:: html
Marker face color
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/options/images/thumb/sphx_glr_plot_dash_capstyle_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_options_plot_dash_capstyle.py` .. raw:: html
Dash capstyle
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/options/images/thumb/sphx_glr_plot_dash_joinstyle_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_options_plot_dash_joinstyle.py` .. raw:: html
Dash join style
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/options/images/thumb/sphx_glr_plot_markers_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_options_plot_markers.py` .. raw:: html
Markers
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/options/images/thumb/sphx_glr_plot_linestyles_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_options_plot_linestyles.py` .. raw:: html
Linestyles
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/options/images/thumb/sphx_glr_plot_ticks_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_options_plot_ticks.py` .. raw:: html
Locators for tick on axis
.. thumbnail-parent-div-close .. raw:: html
Code generating the summary figures with a title ------------------------------------------------- .. raw:: html
.. thumbnail-parent-div-open .. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/pretty_plots/images/thumb/sphx_glr_plot_plot3d_ext_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_pretty_plots_plot_plot3d_ext.py` .. raw:: html
3D plotting vignette
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/pretty_plots/images/thumb/sphx_glr_plot_polar_ext_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_pretty_plots_plot_polar_ext.py` .. raw:: html
Plotting in polar, decorated
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/pretty_plots/images/thumb/sphx_glr_plot_plot_ext_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_pretty_plots_plot_plot_ext.py` .. raw:: html
Plot example vignette
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/pretty_plots/images/thumb/sphx_glr_plot_multiplot_ext_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_pretty_plots_plot_multiplot_ext.py` .. raw:: html
Multiple plots vignette
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/pretty_plots/images/thumb/sphx_glr_plot_boxplot_ext_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_pretty_plots_plot_boxplot_ext.py` .. raw:: html
Boxplot with matplotlib
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/pretty_plots/images/thumb/sphx_glr_plot_scatter_ext_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_pretty_plots_plot_scatter_ext.py` .. raw:: html
Plot scatter decorated
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/pretty_plots/images/thumb/sphx_glr_plot_pie_ext_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_pretty_plots_plot_pie_ext.py` .. raw:: html
Pie chart vignette
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/pretty_plots/images/thumb/sphx_glr_plot_imshow_ext_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_pretty_plots_plot_imshow_ext.py` .. raw:: html
Imshow demo
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/pretty_plots/images/thumb/sphx_glr_plot_bar_ext_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_pretty_plots_plot_bar_ext.py` .. raw:: html
Bar plot advanced
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/pretty_plots/images/thumb/sphx_glr_plot_quiver_ext_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_pretty_plots_plot_quiver_ext.py` .. raw:: html
Plotting quiver decorated
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/pretty_plots/images/thumb/sphx_glr_plot_contour_ext_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_pretty_plots_plot_contour_ext.py` .. raw:: html
Display the contours of a function
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/pretty_plots/images/thumb/sphx_glr_plot_grid_ext_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_pretty_plots_plot_grid_ext.py` .. raw:: html
Grid elaborate
.. raw:: html
.. only:: html .. image:: /intro/matplotlib/auto_examples/pretty_plots/images/thumb/sphx_glr_plot_text_ext_thumb.png :alt: :ref:`sphx_glr_intro_matplotlib_auto_examples_pretty_plots_plot_text_ext.py` .. raw:: html
Text printing decorated
.. thumbnail-parent-div-close .. raw:: html
.. toctree:: :hidden: :includehidden: /intro/matplotlib/auto_examples/exercises/index.rst /intro/matplotlib/auto_examples/options/index.rst /intro/matplotlib/auto_examples/pretty_plots/index.rst .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-gallery .. container:: sphx-glr-download sphx-glr-download-python :download:`Download all examples in Python source code: auto_examples_python.zip ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download all examples in Jupyter notebooks: auto_examples_jupyter.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_