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

Skip to content

DOC: Standardize example titles - part 2 #28641

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions galleries/examples/animation/pause_resume.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
=================================
Pausing and resuming an animation
=================================
=============================
Pause and resume an animation
=============================

This example showcases:

Expand Down
6 changes: 3 additions & 3 deletions galleries/examples/axes_grid1/demo_axes_rgb.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
==================================
Showing RGB channels using RGBAxes
==================================
===============================
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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""
.. _demo-colorbar-with-inset-locator:

==============================================================
Controlling the position and size of colorbars with Inset Axes
==============================================================
===========================================================
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_toolkits.axes_grid1.inset_locator.inset_axes`.
Expand Down
2 changes: 1 addition & 1 deletion galleries/examples/axes_grid1/demo_imagegrid_aspect.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
=========================================
Setting a fixed aspect on ImageGrid cells
ImageGrid cells with a fixed aspect ratio
=========================================
"""

Expand Down
6 changes: 3 additions & 3 deletions galleries/examples/color/custom_cmap.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
=========================================
Creating a colormap from a list of colors
=========================================
=======================================
Create a colormap from a list of colors
=======================================

For more detail on creating and manipulating colormaps see
:ref:`colormap-manipulation`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
===========================
Creating annotated heatmaps
===========================
=================
Annotated heatmap
=================

It is often desirable to show data which depends on two independent
variables as a color coded image plot. This is often referred to as a
Expand Down
6 changes: 3 additions & 3 deletions galleries/examples/lines_bars_and_markers/bar_colors.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
==============
Bar color demo
==============
====================================
Bar chart with individual bar colors
====================================

This is an example showing how to control bar color and legend entries
using the *color* and *label* parameters of `~matplotlib.pyplot.bar`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
==============================
Fill Between with transparency
==============================
==================================
``fill_between`` with transparency
Copy link
Member Author

@timhoffm timhoffm Aug 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So far, there's only one case of formatting example titles (plt.subplots). I feel it's slightly better to format function names as literal rather than just have them as plain text. But no strong opinion. We can also leave out the formatting if desired.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If sphinx doesn't complain, I fully support formatting function names this way

==================================

The `~matplotlib.axes.Axes.fill_between` function generates a shaded
region between a min and max boundary that is useful for illustrating ranges.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
==============================
Filling the area between lines
==============================
===============================
Fill the area between two lines
===============================

This example shows how to use `~.axes.Axes.fill_between` to color the area
between two lines.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
==================
Fill Betweenx Demo
==================
========================================
Fill the area between two vertical lines
========================================

Using `~.Axes.fill_betweenx` to color along the horizontal direction between
two curves.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
==============================
Customizing dashed line styles
==============================
===============================
Dashed line style configuration
===============================

The dashing of a line is controlled via a dash sequence. It can be modified
using `.Line2D.set_dashes`.
Expand Down
6 changes: 3 additions & 3 deletions galleries/examples/lines_bars_and_markers/scatter_masked.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
==========================
Scatter with masked values
==========================
===============================
Scatter plot with masked values
===============================

Mask some data points and add a line demarking
masked regions.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
===========================
Scatter plots with a legend
===========================
==========================
Scatter plot with a legend
==========================

To create a scatter plot with a legend one may use a loop and create one
`~.Axes.scatter` plot per item to appear in the legend and set the ``label``
Expand Down
6 changes: 3 additions & 3 deletions galleries/examples/lines_bars_and_markers/timeline.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
===============================================
Creating a timeline with lines, dates, and text
===============================================
====================================
Timeline with lines, dates, and text
====================================

How to create a simple timeline using Matplotlib release dates.

Expand Down
6 changes: 3 additions & 3 deletions galleries/examples/misc/bbox_intersect.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
===========================================
Changing colors of lines intersecting a box
===========================================
==================================
Identify whether artists intersect
==================================

The lines intersecting the rectangle are colored in red, while the others
are left as blue lines. This example showcases the `.intersects_bbox` function.
Expand Down
2 changes: 1 addition & 1 deletion galleries/examples/misc/demo_ribbon_box.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
==========
Ribbon Box
Ribbon box
==========

"""
Expand Down
15 changes: 8 additions & 7 deletions galleries/examples/misc/fig_x.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"""
=======================
Adding lines to figures
=======================
==============================
Add lines directly to a figure
==============================

Adding lines to a figure without any Axes.
You can add artists such as a `.Line2D` directly to a figure. This is
typically useful for visual structuring.

.. redirect-from:: /gallery/pyplots/fig_x
"""
Expand All @@ -12,9 +13,9 @@

import matplotlib.lines as lines

fig = plt.figure()
fig.add_artist(lines.Line2D([0, 1], [0, 1]))
fig.add_artist(lines.Line2D([0, 1], [1, 0]))
fig, axs = plt.subplots(2, 2, gridspec_kw={'hspace': 0.4, 'wspace': 0.4})
fig.add_artist(lines.Line2D([0, 1], [0.47, 0.47], linewidth=3))
fig.add_artist(lines.Line2D([0.5, 0.5], [1, 0], linewidth=3))
plt.show()

# %%
Expand Down
2 changes: 1 addition & 1 deletion galleries/examples/misc/fill_spiral.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""
===========
Fill Spiral
Fill spiral
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of scope yes but make it OO?

===========

"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
==========================
Labeling a pie and a donut
==========================
=============================
A pie and a donut with labels
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
A pie and a donut with labels
Annotated pie and donut charts

I think the labels here work more like annotations

=============================

Welcome to the Matplotlib bakery. We will create a pie and a donut
chart through the `pie method <matplotlib.axes.Axes.pie>` and
Expand Down
6 changes: 3 additions & 3 deletions galleries/examples/shapes_and_collections/line_collection.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
=============================================
Plotting multiple lines with a LineCollection
=============================================
==========================================
Plot multiple lines using a LineCollection
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Plot multiple lines using a LineCollection
Multiple lines using a LineCollection

Plot is implied? Or say why they'd want to use a LineCollection over a loop?

==========================================

Matplotlib can efficiently draw multiple lines at once using a `~.LineCollection`.
"""
Expand Down
6 changes: 3 additions & 3 deletions galleries/examples/statistics/errorbars_and_boxes.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
====================================================
Creating boxes from error bars using PatchCollection
====================================================
==================================================
Create boxes from error bars using PatchCollection
==================================================

In this example, we snazz up a pretty standard error bar plot by adding
a rectangle patch defined by the limits of the bars in both the x- and
Expand Down
6 changes: 3 additions & 3 deletions galleries/examples/statistics/histogram_cumulative.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
=================================
Plotting cumulative distributions
=================================
========================
Cumulative distributions
========================

This example shows how to plot the empirical cumulative distribution function
(ECDF) of a sample. We also show the theoretical CDF.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
==========================================
Producing multiple histograms side by side
==========================================
================================
Multiple histograms side by side
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Multiple histograms side by side
Grid of histograms

Not quite accurate, really it's a
https://en.m.wikipedia.org/wiki/Small_multiple, but trying to figure out how to convey that the hists are all aligned

================================

This example plots horizontal histograms of different samples along
a categorical x-axis. Additionally, the histograms are plotted to
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
===============================================
Programmatically controlling subplot adjustment
===============================================
===========================================
Programmatically control subplot adjustment
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Programmatically control subplot adjustment
Custom subplot layout adjuster

Something to convey that this should be in user guide or tutorials is not an example is intended to show you how to write a custom layout manager. Biggest objection is programmatically cause that's just what using mpl is

===========================================

.. note::

Expand Down
6 changes: 3 additions & 3 deletions galleries/examples/subplots_axes_and_figures/axhspan_demo.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
=================================
Drawing regions that span an Axes
=================================
==============================
Draw regions that span an Axes
==============================

`~.Axes.axhspan` and `~.Axes.axvspan` draw rectangles that span the Axes in either
the horizontal or vertical direction and are bounded in the other direction. They are
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
=====================================
Resizing Axes with constrained layout
=====================================
===================================
Resize Axes with constrained layout
===================================

*Constrained layout* attempts to resize subplots in
a figure so that there are no overlaps between Axes objects and labels
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
===============================
Resizing Axes with tight layout
===============================
=============================
Resize Axes with tight layout
=============================

`~.Figure.tight_layout` attempts to resize subplots in a figure so that there
are no overlaps between Axes objects and labels on the Axes.
Expand Down
6 changes: 3 additions & 3 deletions galleries/examples/subplots_axes_and_figures/ganged_plots.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
==========================
Creating adjacent subplots
==========================
=================
Adjacent subplots
=================

To create plots that share a common axis (visually) you can set the hspace
between the subplots to zero. Passing sharex=True when creating the subplots
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
==================================================
Combining two subplots using subplots and GridSpec
==================================================
================================================
Combine two subplots using subplots and GridSpec
================================================

Sometimes we want to combine two subplots in an Axes layout created with
`~.Figure.subplots`. We can get the `~.gridspec.GridSpec` from the Axes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
=======================================================
Using Gridspec to make multi-column/row subplot layouts
=======================================================
=============================================
Gridspec for multi-column/row subplot layouts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Gridspec for multi-column/row subplot layouts
Multi-column and row subplot layouts using Gridspec

=============================================

`.GridSpec` is a flexible way to layout
subplot grids. Here is an example with a 3x3 grid, and
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
===================================
Managing multiple figures in pyplot
===================================
=================================
Manage multiple figures in pyplot
=================================

`matplotlib.pyplot` uses the concept of a *current figure* and *current Axes*.
Figures are identified via a figure number that is passed to `~.pyplot.figure`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Sharing axis limits and views
=============================
===========================
Share axis limits and views
===========================

It's common to make two or more plots which share an axis, e.g., two subplots
with time as a common axis. When you pan and zoom around on one, you want the
Expand Down
6 changes: 3 additions & 3 deletions galleries/examples/subplots_axes_and_figures/subplots_demo.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
=================================================
Creating multiple subplots using ``plt.subplots``
=================================================
===============================================
Create multiple subplots using ``plt.subplots``
===============================================

`.pyplot.subplots` creates a figure and a grid of subplots with a single call,
while providing reasonable control over how the individual plots are created.
Expand Down
10 changes: 5 additions & 5 deletions galleries/examples/text_labels_and_annotations/autowrap.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""
==================
Auto-wrapping text
==================
==============
Auto-wrap text
==============

Matplotlib can wrap text automatically, but if it's too long, the text will be
displayed slightly outside of the boundaries of the axis anyways.
Matplotlib can wrap text automatically, but if it's too long, the text will
still be displayed slightly outside the boundaries of the axis.
Comment on lines +6 to +7
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this means since you just told me it can wrap text automatically and this may be better as two sentences


Note: Auto-wrapping does not work together with
``savefig(..., bbox_inches='tight')``. The 'tight' setting rescales the canvas
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
=========================================
Labeling ticks using engineering notation
=========================================
=======================================
Format ticks using engineering notation
=======================================

Use of the engineering Formatter.
"""
Expand Down
Loading