Skip to content

Backport PR #27219 on branch v3.8.x (Updated axes_box_aspect.py and angle_annotation.py to regularize formatting) #27250

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
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
21 changes: 11 additions & 10 deletions galleries/examples/subplots_axes_and_figures/axes_box_aspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

# %%
# A square axes, independent of data
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ----------------------------------
#
# Produce a square axes, no matter what the data limits are.

Expand All @@ -31,7 +31,7 @@

# %%
# Shared square axes
# ~~~~~~~~~~~~~~~~~~
# ------------------
#
# Produce shared subplots that are squared in size.
#
Expand All @@ -47,7 +47,7 @@

# %%
# Square twin axes
# ~~~~~~~~~~~~~~~~
# ----------------
#
# Produce a square axes, with a twin axes. The twinned axes takes over the
# box aspect of the parent.
Expand All @@ -67,7 +67,7 @@

# %%
# Normal plot next to image
# ~~~~~~~~~~~~~~~~~~~~~~~~~
# -------------------------
#
# When creating an image plot with fixed data aspect and the default
# ``adjustable="box"`` next to a normal plot, the axes would be unequal in
Expand All @@ -90,7 +90,7 @@

# %%
# Square joint/marginal plot
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
# --------------------------
#
# It may be desirable to show marginal distributions next to a plot of joint
# data. The following creates a square plot with the box aspect of the
Expand All @@ -115,12 +115,13 @@
plt.show()

# %%
# Square joint/marginal plot
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
# Set data aspect with box aspect
# -------------------------------
#
# When setting the box aspect, one may still set the data aspect as well.
# Here we create an Axes with a box twice as long as tall and use an "equal"
# data aspect for its contents, i.e. the circle actually stays circular.
# Here we create an Axes with a box twice as long as it is tall and use
# an "equal" data aspect for its contents, i.e. the circle actually
# stays circular.

fig6, ax = plt.subplots()

Expand All @@ -133,7 +134,7 @@

# %%
# Box aspect for many subplots
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ----------------------------
#
# It is possible to pass the box aspect to an Axes at initialization. The
# following creates a 2 by 3 subplot grid with all square Axes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

# %%
# AngleAnnotation class
# ~~~~~~~~~~~~~~~~~~~~~
# ---------------------
# The essential idea here is to subclass `~.patches.Arc` and set its transform
# to the `~.transforms.IdentityTransform`, making the parameters of the arc
# defined in pixel space.
Expand Down Expand Up @@ -215,7 +215,7 @@ def R(a, r, w, h):
# .. _angle-annotation-usage:
#
# Usage
# ~~~~~
# -----
#
# Required arguments to ``AngleAnnotation`` are the center of the arc, *xy*,
# and two points, such that the arc spans between the two vectors connecting
Expand Down Expand Up @@ -254,7 +254,7 @@ def R(a, r, w, h):

# %%
# ``AngleLabel`` options
# ~~~~~~~~~~~~~~~~~~~~~~
# ----------------------
#
# The *textposition* and *unit* keyword arguments may be used to modify the
# location of the text label, as shown below:
Expand Down