8000 Merge remote-tracking branch 'origin/v3.0.2-doc' into v3.0.x-pi · matplotlib/matplotlib@a8933ef · GitHub
[go: up one dir, main page]

Skip to content

Commit a8933ef

Browse files
committed
Merge remote-tracking branch 'origin/v3.0.2-doc' into v3.0.x-pi
Conflicts: .appveyor.yml - kept version from this branch doc/api/api_changes.rst - kept version from this branch, due to moving text around requirements/testing/travis_all.txt - kept version from this branch
2 parents 31d5269 + 003cd72 commit a8933ef

File tree

4 files changed

+33
-4
lines changed

4 files changed

+33
-4
lines changed

.flake8

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ per-file-ignores =
253253
examples/subplots_axes_and_figures/zoom_inset_axes.py: E402
254254
examples/tests/backend_driver_sgskip.py: E402, E501
255255
examples/text_labels_and_annotations/annotation_demo.py: E501
256+
examples/text_labels_and_annotations/demo_text_rotation_mode.py: E402
256257
examples/text_labels_and_annotations/custom_legends.py: E402
257258
examples/text_labels_and_annotations/font_family_rc_sgskip.py: E402
258259
examples/text_labels_and_annotations/font_file.py: E402

doc/api/api_changes.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,3 @@ Switching backends via `matplotlib.use` is now allowed by default,
5252
regardless of whether `matplotlib.pyplot` has been imported. If the user
5353
tries to switch from an already-started interactive backend to a different
5454
interactive backend, an ImportError will be raised.
55-
56-

doc/citing.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ publication, please acknowledge this fact by citing `Hunter et al (2007)
2727
2828
DOIs
2929
----
30+
v3.0.2
31+
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.1482099.svg
32+
:target: https://doi.org/10.5281/zenodo.1482099
33+
v3.0.1
34+
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.1482098.svg
35+
:target: https://doi.org/10.5281/zenodo.1482098
3036
v3.0.0
3137
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.1420605.svg
3238
:target: https://doi.org/10.5281/zenodo.1420605

examples/text_labels_and_annotations/demo_text_rotation_mode.py

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1-
"""
2-
=======================
1+
"""=======================
32
Demo Text Rotation Mode
43
=======================
54
5+
The axes' method `~.axes.Axes.text` takes an argument ``rotation_mode`` that
6+
controls the alignment and rotation of the text. If ``rotation_mode`` is
7+
``None`` or ``default`` the text will first be rotated and then aligned
8+
according to the horizontal and vertical alignments (``ha`` and ``va`` in the
9+
example). If ``rotation_mode`` is ``anchor`` the text is aligned before
10+
rotation.
11+
612
"""
713
from mpl_toolkits.axes_grid1.axes_grid import ImageGrid
814

@@ -19,18 +25,23 @@ def test_rotation_mode(fig, mode, subplot_location):
1925
for ha, ax in zip(ha_list, grid.axes_row[-1]):
2026
ax.axis["bottom"].label.set_text(ha)
2127

28+
# create a grid of axes to display text on.
2229
grid.axes_row[0][1].set_title(mode, size="large")
2330

2431
for va, ax in zip(va_list, grid.axes_column[0]):
2532
ax.axis["left"].label.set_text(va)
2633

34+
# use a different horizontal and vertical alignment for the text in each
35+
# axes.
2736
i = 0
2837
for va in va_list:
2938
for ha in ha_list:
3039
ax = grid[i]
3140
for axis in ax.axis.values():
3241
axis.toggle(ticks=False, ticklabels=False)
3342

43+
# add text to the axes. Set the rotation_mode, horizontal
44+
# alignment (ha) and vertical alignment (va).
3445
ax.text(0.5, 0.5, "Tpg",
3546
size="large", rotation=40,
3647
bbox=dict(boxstyle="square,pad=0.",
@@ -50,3 +61,16 @@ def test_rotation_mode(fig, mode, subplot_location):
5061
test_rotation_mode(fig, "default", 121)
5162
test_rotation_mode(fig, "anchor", 122)
5263
plt.show()
64+
65+
66+
#############################################################################
67+
#
68+
# ------------
69+
#
70+
# References
71+
# """"""""""
72+
#
73+
# The use of the following method is shown in this example:
74+
75+
import matplotlib
76+
matplotlib.axes.Axes.text

0 commit comments

Comments
 (0)
0