Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Remove What's new fancy example #13685

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 3 commits into from
Jun 24, 2019
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
2 changes: 1 addition & 1 deletion 2 .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ per-file-ignores =
examples/pyplots/text_commands.py: E231, E402
examples/pyplots/text_layout.py: E231, E402
examples/pyplots/whats_new_1_subplot3d.py: E402
examples/pyplots/whats_new_98_4_fancy.py: E302, E402
examples/pyplots/whats_new_98_4_fill_between.py: E225, E402
examples/pyplots/whats_new_98_4_legend.py: E228, E402
examples/pyplots/whats_new_99_axes_grid.py: E402
Expand Down Expand Up @@ -229,6 +228,7 @@ per-file-ignores =
examples/text_labels_and_annotations/annotation_demo.py: E501
examples/text_labels_and_annotations/demo_text_rotation_mode.py: E402
examples/text_labels_and_annotations/custom_legends.py: E402
examples/text_labels_and_annotations/fancyarrow_demo.py: E402
examples/text_labels_and_annotations/font_family_rc_sgskip.py: E402
examples/text_labels_and_annotations/font_file.py: E402
examples/text_labels_and_annotations/legend.py: E402
Expand Down
75 changes: 63 additions & 12 deletions 75 doc/users/prev_whats_new/whats_new_0.98.4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ submitted patches
.. _legend-refactor:

Legend enhancements
--------------------
-------------------

Jae-Joon has rewritten the legend class, and added support for
multiple columns and rows, as well as fancy box drawing. See
Expand All @@ -40,7 +40,7 @@ multiple columns and rows, as well as fancy box drawing. See
.. _fancy-annotations:

Fancy annotations and arrows
-----------------------------
----------------------------

Jae-Joon has added lots of support to annotations for drawing fancy
boxes and connectors in annotations. See
Expand All @@ -49,18 +49,66 @@ boxes and connectors in annotations. See
:class:`~matplotlib.patches.ArrowStyle`, and
:class:`~matplotlib.patches.ConnectionStyle`.

.. figure:: ../../gallery/pyplots/images/sphx_glr_whats_new_98_4_fancy_001.png
:target: ../../gallery/pyplots/whats_new_98_4_fancy.html
:align: center
:scale: 50
.. plot::

Whats New 98 4 Fancy
import matplotlib.patches as mpatch
import matplotlib.pyplot as plt

.. _psd-amplitude:
figheight = 4
fig = plt.figure(figsize=(4.5, figheight), dpi=80)
fontsize = 0.2 * fig.dpi

def make_boxstyles(ax):
styles = mpatch.BoxStyle.get_styles()

for i, (stylename, styleclass) in enumerate(sorted(styles.items())):
ax.text(0.5, (float(len(styles)) - 0.5 - i)/len(styles), stylename,
ha="center",
size=fontsize,
transform=ax.transAxes,
bbox=dict(boxstyle=stylename, fc="w", ec="k"))

def make_arrowstyles(ax):
styles = mpatch.ArrowStyle.get_styles()

ax.set_xlim(0, 4)
ax.set_ylim(0, figheight*2)

for i, (stylename, styleclass) in enumerate(sorted(styles.items())):
y = (float(len(styles)) - 0.25 - i) # /figheight
p = mpatch.Circle((3.2, y), 0.2, fc="w")
ax.add_patch(p)

ax.annotate(stylename, (3.2, y),
(2., y),
# xycoords="figure fraction", textcoords="figure fraction",
ha="right", va="center",
size=fontsize,
arrowprops=dict(arrowstyle=stylename,
patchB=p,
shrinkA=5,
shrinkB=5,
fc="w", ec="k",
connectionstyle="arc3,rad=-0.05",
),
bbox=dict(boxstyle="square", fc="w"))

ax.xaxis.set_visible(False)
ax.yaxis.set_visible(False)


ax1 = fig.add_subplot(121, frameon=False, xticks=[], yticks=[])
make_boxstyles(ax1)

ax2 = fig.add_subplot(122, frameon=False, xticks=[], yticks=[])
make_arrowstyles(ax2)


plt.show()


Native OS X backend
--------------------
-------------------

Michiel de Hoon has provided a native Mac OSX backend that is almost
completely implemented in C. The backend can therefore use Quartz
Expand All @@ -74,8 +122,11 @@ matplotlibrc file, or run your script with::

> python myfile.py -dmacosx


.. _psd-amplitude:

psd amplitude scaling
-------------------------
---------------------

Ryan May did a lot of work to rationalize the amplitude scaling of
:func:`~matplotlib.pyplot.psd` and friends. See
Expand All @@ -86,7 +137,7 @@ compatibility and increase scaling options.
.. _fill-between:

Fill between
------------------
------------

Added a :func:`~matplotlib.pyplot.fill_between` function to make it
easier to do shaded region plots in the presence of masked data. You
Expand All @@ -102,7 +153,7 @@ where you want to do the filling.
Whats New 98 4 Fill Between

Lots more
-----------
---------

Here are the 0.98.4 notes from the CHANGELOG::

Expand Down
80 changes: 0 additions & 80 deletions 80 examples/pyplots/whats_new_98_4_fancy.py

This file was deleted.

2 changes: 2 additions & 0 deletions 2 examples/shapes_and_collections/fancybox_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,5 @@ def test_all():
matplotlib.patches.BoxStyle
matplotlib.patches.BoxStyle.get_styles
matplotlib.transforms.Bbox
matplotlib.figure.Figure.text
matplotlib.axes.Axes.text
16 changes: 16 additions & 0 deletions 16 examples/text_labels_and_annotations/fancyarrow_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,19 @@ def to_texstring(s):
ax.yaxis.set_visible(False)

plt.show()

#############################################################################
#
# ------------
#
# References
# """"""""""
#
# The use of the following functions, methods, classes and modules is shown
# in this example:

import matplotlib
matplotlib.patches
matplotlib.patches.ArrowStyle
matplotlib.patches.ArrowStyle.get_styles
matplotlib.axes.Axes.annotate
Morty Proxy This is a proxified and sanitized view of the page, visit original site.