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

Skip to content

Commit b243b2f

Browse files
committed
Merge v1.4.x into master
2 parents 95a9ef8 + b2b5227 commit b243b2f

6 files changed

Lines changed: 79 additions & 3 deletions

File tree

doc/make.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,31 @@ def all():
149149
('mpl_toolkits/axes_grid/examples', '../../../examples/axes_grid/')
150150
]
151151

152+
symlink_warnings = []
152153
for link, target in required_symlinks:
154+
if sys.platform == 'win32' and os.path.isfile(link):
155+
# This is special processing that applies on platforms that don't deal
156+
# with git symlinks -- probably only MS windows.
157+
delete = False
158+
with open(link, 'r') as content:
159+
delete = target == content.read()
160+
if delete:
161+
symlink_warnings.append('deleted: doc/{}'.format(link))
162+
os.unlink(link)
163+
else:
164+
raise RuntimeError("doc/{} should be a directory or symlink -- it isn't")
153165
if not os.path.exists(link):
154166
if hasattr(os, 'symlink'):
155167
os.symlink(target, link)
156168
else:
169+
symlink_warnings.append('files copied to {}'.format(link))
157170
shutil.copytree(os.path.join(link, '..', target), link)
158171

172+
if sys.platform == 'win32' and len(symlink_warnings) > 0:
173+
print('The following items related to symlinks will show up '+
174+
'as spurious changes in your \'git status\':\n\t{}'
175+
.format('\n\t'.join(symlink_warnings)))
176+
159177
if len(sys.argv)>1:
160178
if '--small' in sys.argv[1:]:
161179
small_docs = True

doc/users/whats_new.rst

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,28 @@ legibility through brightness variations. See
5656
`here <https://github.com/wistia/heatmap-palette>`_
5757
for more information.
5858

59-
Documentation changes
60-
---------------------
59+
The nbagg backend
60+
-----------------
61+
Phil Elson added a new backend, named "nbagg", which enables interactive
62+
figures in a live IPython notebook session. The backend makes use of the
63+
infrastructure developed for the webagg backend, which itself gives
64+
standalone server backed interactive figures in the browser, however nbagg
65+
does not require a dedicated matplotlib server as all communications are
66+
handled through the IPython Comm machinery.
67+
68+
As with other backends nbagg can be enabled inside the IPython notebook with::
69+
70+
import matplotlib
71+
matplotlib.use('nbagg')
72+
73+
Once figures are created and then subsequently shown, they will placed in an
74+
interactive widget inside the notebook allowing panning and zooming in the
75+
same way as any other matplotlib backend. Because figures require a connection
76+
to the IPython notebook server for their interactivity, once the notebook is
77+
saved, each figure will be rendered as a static image - thus allowing
78+
non-interactive viewing of figures on services such as
79+
`nbviewer <http://nbviewer.ipython.org/>`_.
6180

62-
Phil Elson rewrote of the documentation and userguide for both Legend and PathEffects (links needed).
6381

6482

6583
New plotting features
@@ -284,6 +302,7 @@ Controls whether figures are saved with a transparent
284302
background by default. Previously `savefig` always defaulted
285303
to a non-transparent background.
286304

305+
287306
``axes.titleweight``
288307
````````````````````
289308
Added rcParam to control the weight of the title
@@ -296,6 +315,12 @@ an offset will be determined such that the tick labels are
296315
meaningful. If `False` then the full number will be formatted in all
297316
conditions.
298317

318+
``nbagg.transparent`` added
319+
`````````````````````````````
320+
Controls whether nbagg figures have a transparent
321+
background. ``nbagg.transparent`` is ``True`` by default.
322+
323+
299324
XDG compliance
300325
``````````````
301326
Matplotlib now looks for configuration files (both rcparams and style) in XDG
@@ -402,6 +427,12 @@ cause the context to be reset. This allows more than one distinct context to
402427
be present in documentation. To enable this option, use ``:context: reset``
403428
instead of ``:context:`` any time you want to reset the context.
404429

430+
Legend and PathEffects documentation
431+
------------------------------------
432+
The :ref:`plotting-guide-legend` and :ref:`patheffects-guide` have both been
433+
updated to better reflect the full potential of each of these powerful
434+
features.
435+
405436
Widgets
406437
-------
407438

lib/matplotlib/axes/_axes.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3064,6 +3064,8 @@ def boxplot(self, x, notch=False, sym=None, vert=True, whis=1.5,
30643064
flierprops = dict(linestyle='none', marker='',
30653065
markeredgecolor='none',
30663066
markerfacecolor='none')
3067+
# turn the fliers off just to be safe
3068+
showfliers = False
30673069
# now process the symbol string
30683070
else:
30693071
# process the symbol string

lib/matplotlib/collections.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,15 @@ def get_numsides(self):
927927
def get_rotation(self):
928928
return self._rotation
929929

930+
@allow_rasterization
931+
def draw(self, renderer):
932+
self.set_sizes(self._sizes, self.figure.dpi)
933+
self._transforms = [
934+
transforms.Affine2D(x).rotate(-self._rotation).get_matrix()
935+
for x in self._transforms
936+
]
937+
Collection.draw(self, renderer)
938+
930939

931940
class StarPolygonCollection(RegularPolyCollection):
932941
"""
78.8 KB
Loading

lib/matplotlib/tests/test_collections.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,22 @@ def test_polycollection_close():
513513
ax.set_ylim3d(0, 4)
514514

515515

516+
@image_comparison(baseline_images=['regularpolycollection_rotate'],
517+
extensions=['png'], remove_text=True)
518+
def test_regularpolycollection_rotate():
519+
xx, yy = np.mgrid[:10, :10]
520+
xy_points = np.transpose([xx.flatten(), yy.flatten()])
521+
rotations = np.linspace(0, 2*np.pi, len(xy_points))
522+
523+
fig, ax = plt.subplots()
524+
for xy, alpha in zip(xy_points, rotations):
525+
col = mcollections.RegularPolyCollection(
526+
4, sizes=(100,), rotation=alpha,
527+
offsets=xy, transOffset=ax.transData)
528+
ax.add_collection(col, autolim=True)
529+
ax.autoscale_view()
530+
531+
516532
if __name__ == '__main__':
517533
import nose
518534
nose.runmodule(argv=['-s', '--with-doctest'], exit=False)

0 commit comments

Comments
 (0)