1.. _whats-new-1-5: 2 3New in matplotlib 1.5 4===================== 5 6.. contents:: Table of Contents 7 :depth: 2 8 9 10.. note:: 11 12 matplotlib 1.5 supports Python 2.7, 3.4, and 3.5 13 14 15 16 17 18 19Interactive OO usage 20-------------------- 21 22All `Artists` now keep track of if their internal state has been 23changed but not reflected in the display ('stale') by a call to 24``draw``. It is thus possible to pragmatically determine if a given 25`Figure` needs to be re-drawn in an interactive session. 26 27To facilitate interactive usage a ``draw_all`` method has been added 28to ``pyplot`` which will redraw all of the figures which are 'stale'. 29 30To make this convenient for interactive use matplotlib now registers 31a function either with IPython's 'post_execute' event or with the 32displayhook in the standard python REPL to automatically call 33``plt.draw_all`` just before control is returned to the REPL. This ensures 34that the draw command is deferred and only called once. 35 36The upshot of this is that for interactive backends (including 37``%matplotlib notebook``) in interactive mode (with ``plt.ion()``) 38 39.. ipython :: python 40 41 import matplotlib.pyplot as plt 42 43 fig, ax = plt.subplots() 44 45 ln, = ax.plot([0, 1, 4, 9, 16]) 46 47 plt.show() 48 49 ln.set_color('g') 50 51 52will automatically update the plot to be green. Any subsequent 53modifications to the ``Artist`` objects will do likewise. 54 55This is the first step of a larger consolidation and simplification of 56the pyplot internals. 57 58 59Working with labeled data like pandas DataFrames 60------------------------------------------------ 61Plot methods which take arrays as inputs can now also work with labeled data 62and unpack such data. 63 64This means that the following two examples produce the same plot: 65 66Example :: 67 68 df = pandas.DataFrame({"var1":[1,2,3,4,5,6], "var2":[1,2,3,4,5,6]}) 69 plt.plot(df["var1"], df["var2"]) 70 71 72Example :: 73 74 plt.plot("var1", "var2", data=df) 75 76This works for most plotting methods, which expect arrays/sequences as 77inputs. ``data`` can be anything which supports ``__getitem__`` 78(``dict``, ``pandas.DataFrame``, ``h5py``, ...) to access ``array`` like 79values with string keys. 80 81In addition to this, some other changes were made, which makes working with 82labeled data (ex ``pandas.Series``) easier: 83 84* For plotting methods with ``label`` keyword argument, one of the 85 data inputs is designated as the label source. If the user does not 86 supply a ``label`` that value object will be introspected for a 87 label, currently by looking for a ``name`` attribute. If the value 88 object does not have a ``name`` attribute but was specified by as a 89 key into the ``data`` kwarg, then the key is used. In the above 90 examples, this results in an implicit ``label="var2"`` for both 91 cases. 92 93* ``plot()`` now uses the index of a ``Series`` instead of 94 ``np.arange(len(y))``, if no ``x`` argument is supplied. 95 96 97Added ``axes.prop_cycle`` key to rcParams 98----------------------------------------- 99 100This is a more generic form of the now-deprecated ``axes.color_cycle`` param. 101Now, we can cycle more than just colors, but also linestyles, hatches, 102and just about any other artist property. Cycler notation is used for 103defining property cycles. Adding cyclers together will be like you are 104`zip()`-ing together two or more property cycles together:: 105 106 axes.prop_cycle: cycler('color', 'rgb') + cycler('lw', [1, 2, 3]) 107 108You can even multiply cyclers, which is like using `itertools.product()` 109on two or more property cycles. Remember to use parentheses if writing 110a multi-line `prop_cycle` parameter. 111 112.. figure:: ../../tutorials/intermediate/images/sphx_glr_color_cycle_001.png 113 :target: ../../tutorials/intermediate/color_cycle.html 114 :align: center 115 :scale: 50 116 117 Color Cycle 118 119 120New Colormaps 121-------------- 122 123All four of the colormaps proposed as the new default are available 124as ``'viridis'`` (the new default in 2.0), ``'magma'``, ``'plasma'``, and 125``'inferno'`` 126 127.. plot:: 128 129 import numpy as np 130 from cycler import cycler 131 cmap = cycler('cmap', ['viridis', 'magma','plasma', 'inferno']) 132 x_mode = cycler('x', [1, 2]) 133 y_mode = cycler('y', x_mode) 134 135 cy = (x_mode * y_mode) + cmap 136 137 def demo(ax, x, y, cmap): 138 X, Y = np.ogrid[0:2*np.pi:200j, 0:2*np.pi:200j] 139 data = np.sin(X*x) * np.cos(Y*y) 140 ax.imshow(data, interpolation='none', cmap=cmap) 141 ax.set_title(cmap) 142 143 fig, axes = plt.subplots(2, 2) 144 for ax, sty in zip(axes.ravel(), cy): 145 demo(ax, **sty) 146 147 fig.tight_layout() 148 149 150Styles 151------ 152 153Several new styles have been added, including many styles from the 154Seaborn project. Additionally, in order to prep for the upcoming 2.0 155style-change release, a 'classic' and 'default' style has been added. 156For this release, the 'default' and 'classic' styles are identical. 157By using them now in your scripts, you can help ensure a smooth 158transition during future upgrades of matplotlib, so that you can 159upgrade to the snazzy new defaults when you are ready! :: 160 161 import matplotlib.style 162 matplotlib.style.use('classic') 163 164The 'default' style will give you matplotlib's latest plotting styles:: 165 166 matplotlib.style.use('default') 167 168Backends 169-------- 170 171New backend selection 172````````````````````` 173 174The environment variable :envvar:`MPLBACKEND` can now be used to set the 175matplotlib backend. 176 177 178wx backend has been updated 179``````````````````````````` 180 181The wx backend can now be used with both wxPython classic and 182`Phoenix <http://wxpython.org/Phoenix/docs/html/main.html>`__. 183 184wxPython classic has to be at least version 2.8.12 and works on Python 2.x. As 185of May 2015 no official release of wxPython Phoenix is available but a 186current snapshot will work on Python 2.7+ and 3.4+. 187 188If you have multiple versions of wxPython installed, then the user code is 189responsible setting the wxPython version. How to do this is 190explained in the comment at the beginning of the example 191`examples\user_interfaces\embedding_in_wx2.py`. 192 193Configuration (rcParams) 194------------------------ 195 196Some parameters have been added, others have been improved. 197 198+-------------------------+--------------------------------------------------+ 199| Parameter | Description | 200+=========================+==================================================+ 201|`{x,y}axis.labelpad` | mplot3d now respects these parameters | 202+-------------------------+--------------------------------------------------+ 203|`axes.labelpad` | Default space between the axis and the label | 204+-------------------------+--------------------------------------------------+ 205|`errorbar.capsize` | Default length of end caps on error bars | 206+-------------------------+--------------------------------------------------+ 207|`{x,y}tick.minor.visible`| Default visibility of minor x/y ticks | 208+-------------------------+--------------------------------------------------+ 209|`legend.framealpha` | Default transparency of the legend frame box | 210+-------------------------+--------------------------------------------------+ 211|`legend.facecolor` | Default facecolor of legend frame box (or | 212| | ``'inherit'`` from `axes.facecolor`) | 213+-------------------------+--------------------------------------------------+ 214|`legend.edgecolor` | Default edgecolor of legend frame box (or | 215| | ``'inherit'`` from `axes.edgecolor`) | 216+-------------------------+--------------------------------------------------+ 217|`figure.titlesize` | Default font size for figure suptitles | 218+-------------------------+--------------------------------------------------+ 219|`figure.titleweight` | Default font weight for figure suptitles | 220+-------------------------+--------------------------------------------------+ 221|`image.composite_image` | Whether a vector graphics backend should | 222| | composite several images into a single image or | 223| | not when saving. Useful when needing to edit the | 224| | files further in Inkscape or other programs. | 225+-------------------------+--------------------------------------------------+ 226|`markers.fillstyle` | Default fillstyle of markers. Possible values | 227| | are ``'full'`` (the default), ``'left'``, | 228| | ``'right'``, ``'bottom'``, ``'top'`` and | 229| | ``'none'`` | 230+-------------------------+--------------------------------------------------+ 231|`toolbar` | Added ``'toolmanager'`` as a valid value, | 232| | enabling the experimental ``ToolManager`` | 233| | feature. | 234+-------------------------+--------------------------------------------------+ 235 236 237Widgets 238------- 239 240Active state of Selectors 241````````````````````````` 242 243All selectors now implement ``set_active`` and ``get_active`` methods (also 244called when accessing the ``active`` property) to properly update and query 245whether they are active. 246 247 248Moved ``ignore``, ``set_active``, and ``get_active`` methods to base class ``Widget`` 249````````````````````````````````````````````````````````````````````````````````````` 250 251Pushes up duplicate methods in child class to parent class to avoid duplication of code. 252 253 254Adds enable/disable feature to MultiCursor 255`````````````````````````````````````````` 256 257A MultiCursor object can be disabled (and enabled) after it has been created without destroying the object. 258Example:: 259 260 multi_cursor.active = False 261 262 263Improved RectangleSelector and new EllipseSelector Widget 264````````````````````````````````````````````````````````` 265 266Adds an `interactive` keyword which enables visible handles for manipulating the shape after it has been drawn. 267 268Adds keyboard modifiers for: 269 270- Moving the existing shape (default key = 'space') 271- Making the shape square (default 'shift') 272- Make the initial point the center of the shape (default 'control') 273- Square and center can be combined 274 275Allow Artists to Display Pixel Data in Cursor 276````````````````````````````````````````````` 277 278Adds `get_pixel_data` and `format_pixel_data` methods to artists 279which can be used to add zdata to the cursor display 280in the status bar. Also adds an implementation for Images. 281 282 283New plotting features 284--------------------- 285 286 287Auto-wrapping Text 288`````````````````` 289 290Added the keyword argument "wrap" to Text, which automatically breaks 291long lines of text when being drawn. Works for any rotated text, 292different modes of alignment, and for text that are either labels or 293titles. This breaks at the ``Figure``, not ``Axes`` edge. 294 295.. plot:: 296 297 fig, ax = plt.subplots() 298 fig.patch.set_color('.9') 299 ax.text(.5, .75, 300 "This is a really long string that should be wrapped so that " 301 "it does not go outside the figure.", wrap=True) 302 303Contour plot corner masking 304``````````````````````````` 305 306Ian Thomas rewrote the C++ code that calculates contours to add support for 307corner masking. This is controlled by a new keyword argument 308``corner_mask`` in the functions :func:`~matplotlib.pyplot.contour` and 309:func:`~matplotlib.pyplot.contourf`. The previous behaviour, which is now 310obtained using ``corner_mask=False``, was for a single masked point to 311completely mask out all four quads touching that point. The new behaviour, 312obtained using ``corner_mask=True``, only masks the corners of those 313quads touching the point; any triangular corners comprising three unmasked 314points are contoured as usual. If the ``corner_mask`` keyword argument is not 315specified, the default value is taken from rcParams. 316 317.. figure:: ../../gallery/images_contours_and_fields/images/sphx_glr_contour_corner_mask_001.png 318 :target: ../../gallery/images_contours_and_fields/contour_corner_mask.html 319 :align: center 320 :scale: 50 321 322 Contour Corner Mask 323 324 325Mostly unified linestyles for `Line2D`, `Patch` and `Collection` 326````````````````````````````````````````````````````````````````` 327 328The handling of linestyles for Lines, Patches and Collections has been 329unified. Now they all support defining linestyles with short symbols, 330like `"--"`, as well as with full names, like ``"dashed"``. Also the 331definition using a dash pattern (``(0., [3., 3.])``) is supported for all 332methods using `Line2D`, `Patch` or ``Collection``. 333 334 335Legend marker order 336``````````````````` 337 338Added ability to place the label before the marker in a legend box with 339``markerfirst`` keyword 340 341 342Support for legend for PolyCollection and stackplot 343``````````````````````````````````````````````````` 344 345Added a `legend_handler` for :class:`~matplotlib.collections.PolyCollection` as well as a `labels` argument to 346:func:`~matplotlib.axes.Axes.stackplot`. 347 348 349Support for alternate pivots in mplot3d quiver plot 350``````````````````````````````````````````````````` 351 352Added a :code:`pivot` kwarg to :func:`~mpl_toolkits.mplot3d.Axes3D.quiver` 353that controls the pivot point around which the quiver line rotates. This also 354determines the placement of the arrow head along the quiver line. 355 356 357Logit Scale 358``````````` 359 360Added support for the 'logit' axis scale, a nonlinear transformation 361 362.. math:: 363 364 x -> \log10(x / (1-x)) 365 366for data between 0 and 1 excluded. 367 368 369Add step kwargs to fill_between 370``````````````````````````````` 371 372Added ``step`` kwarg to `Axes.fill_between` to allow to fill between 373lines drawn using the 'step' draw style. The values of ``step`` match 374those of the ``where`` kwarg of `Axes.step`. The asymmetry of of the 375kwargs names is not ideal, but `Axes.fill_between` already has a 376``where`` kwarg. 377 378This is particularly useful for plotting pre-binned histograms. 379 380.. figure:: ../../gallery/api/images/sphx_glr_filled_step_001.png 381 :target: ../../gallery/api/filled_step.html 382 :align: center 383 :scale: 50 384 385 Filled Step 386 387 388Square Plot 389``````````` 390 391Implemented square plots feature as a new parameter in the axis 392function. When argument 'square' is specified, equal scaling is set, 393and the limits are set such that ``xmax-xmin == ymax-ymin``. 394 395.. plot:: 396 397 fig, ax = plt.subplots() 398 ax.axis('square') 399 400 401Updated figimage to take optional resize parameter 402`````````````````````````````````````````````````` 403 404Added the ability to plot simple 2D-Array using ``plt.figimage(X, resize=True)``. 405This is useful for plotting simple 2D-Array without the Axes or whitespacing 406around the image. 407 408.. plot:: 409 410 data = np.random.random([500, 500]) 411 plt.figimage(data, resize=True) 412 413Updated Figure.savefig() can now use figure's dpi 414````````````````````````````````````````````````` 415 416Added support to save the figure with the same dpi as the figure on the 417screen using `dpi='figure'`. 418 419Example:: 420 421 f = plt.figure(dpi=25) # dpi set to 25 422 S = plt.scatter([1,2,3],[4,5,6]) 423 f.savefig('output.png', dpi='figure') # output savefig dpi set to 25 (same as figure) 424 425 426Updated Table to control edge visibility 427```````````````````````````````````````` 428 429Added the ability to toggle the visibility of lines in Tables. 430Functionality added to the :func:`pyplot.table` factory function under 431the keyword argument "edges". Values can be the strings "open", "closed", 432"horizontal", "vertical" or combinations of the letters "L", "R", "T", 433"B" which represent left, right, top, and bottom respectively. 434 435Example:: 436 437 table(..., edges="open") # No line visible 438 table(..., edges="closed") # All lines visible 439 table(..., edges="horizontal") # Only top and bottom lines visible 440 table(..., edges="LT") # Only left and top lines visible. 441 442Zero r/cstride support in plot_wireframe 443```````````````````````````````````````` 444 445Adam Hughes added support to mplot3d's plot_wireframe to draw only row or 446column line plots. 447 448 449.. plot:: 450 451 from mpl_toolkits.mplot3d import Axes3D, axes3d 452 fig = plt.figure() 453 ax = fig.add_subplot(111, projection='3d') 454 X, Y, Z = axes3d.get_test_data(0.05) 455 ax.plot_wireframe(X, Y, Z, rstride=10, cstride=0) 456 457 458Plot bar and barh with labels 459````````````````````````````` 460 461Added kwarg ``"tick_label"`` to `bar` and `barh` to support plotting bar graphs with a 462text label for each bar. 463 464.. plot:: 465 466 plt.bar([1, 2], [.5, .75], tick_label=['bar1', 'bar2'], 467 align='center') 468 469Added center and frame kwargs to pie 470```````````````````````````````````` 471 472These control where the center of the pie graph are and if 473the Axes frame is shown. 474 475Fixed 3D filled contour plot polygon rendering 476`````````````````````````````````````````````` 477 478Certain cases of 3D filled contour plots that produce polygons with multiple 479holes produced improper rendering due to a loss of path information between 480:class:`~matplotlib.collections.PolyCollection` and 481:class:`~mpl_toolkits.mplot3d.art3d.Poly3DCollection`. A function 482:func:`~matplotlib.collections.PolyCollection.set_verts_and_codes` was 483added to allow path information to be retained for proper rendering. 484 485Dense colorbars are rasterized 486`````````````````````````````` 487 488Vector file formats (pdf, ps, svg) are efficient for 489many types of plot element, but for some they can yield 490excessive file size and even rendering artifacts, depending 491on the renderer used for screen display. This is a problem 492for colorbars that show a large number of shades, as is 493most commonly the case. Now, if a colorbar is showing 49450 or more colors, it will be rasterized in vector 495backends. 496 497 498DateFormatter strftime 499`````````````````````` 500:class:`~matplotlib.dates.DateFormatter`s' 501:meth:`~matplotlib.dates.DateFormatter.strftime` method will format 502a :class:`datetime.datetime` object with the format string passed to 503the formatter's constructor. This method accepts datetimes with years 504before 1900, unlike :meth:`datetime.datetime.strftime`. 505 506 507Artist-level {get,set}_usetex for text 508`````````````````````````````````````` 509 510Add ``{get,set}_usetex`` methods to :class:`~matplotlib.text.Text` objects 511which allow artist-level control of LaTeX rendering vs the internal mathtex 512rendering. 513 514 515`ax.remove()` works as expected 516``````````````````````````````` 517 518As with artists added to an :class:`~matplotlib.axes.Axes`, 519`Axes` objects can be removed from their figure via 520:meth:`~matplotlib.axes.Axes.remove()`. 521 522 523API Consistency fix within Locators set_params() function 524````````````````````````````````````````````````````````` 525 526:meth:`~matplotlib.ticker.Locator.set_params` function, which sets parameters 527within a :class:`~matplotlib.ticker.Locator` type 528instance, is now available to all `Locator` types. The implementation 529also prevents unsafe usage by strictly defining the parameters that a 530user can set. 531 532To use, call ``set_params()`` on a `Locator` instance with desired arguments: 533:: 534 535 loc = matplotlib.ticker.LogLocator() 536 # Set given attributes for loc. 537 loc.set_params(numticks=8, numdecs=8, subs=[2.0], base=8) 538 # The below will error, as there is no such parameter for LogLocator 539 # named foo 540 # loc.set_params(foo='bar') 541 542 543Date Locators 544````````````` 545 546Date Locators (derived from :class:`~matplotlib.dates.DateLocator`) now 547implement the :meth:`~matplotlib.tickers.Locator.tick_values` method. 548This is expected of all Locators derived from :class:`~matplotlib.tickers.Locator`. 549 550The Date Locators can now be used easily without creating axes :: 551 552 from datetime import datetime 553 from matplotlib.dates import YearLocator 554 t0 = datetime(2002, 10, 9, 12, 10) 555 tf = datetime(2005, 10, 9, 12, 15) 556 loc = YearLocator() 557 values = loc.tick_values(t0, tf) 558 559OffsetBoxes now support clipping 560```````````````````````````````` 561 562`Artists` draw onto objects of type :class:`~OffsetBox` 563through :class:`~OffsetBox.DrawingArea` and :class:`~OffsetBox.TextArea`. 564The `TextArea` calculates the required space for the text and so the 565text is always within the bounds, for this nothing has changed. 566 567However, `DrawingArea` acts as a parent for zero or more `Artists` that 568draw on it and may do so beyond the bounds. Now child `Artists` can be 569clipped to the bounds of the `DrawingArea`. 570 571 572OffsetBoxes now considered by tight_layout 573`````````````````````````````````````````` 574 575When `~matplotlib.pyplot.tight_layout()` or `Figure.tight_layout()` 576or `GridSpec.tight_layout()` is called, `OffsetBoxes` that are 577anchored outside the axes will not get chopped out. The `OffsetBoxes` will 578also not get overlapped by other axes in case of multiple subplots. 579 580Per-page pdf notes in multi-page pdfs (PdfPages) 581```````````````````````````````````````````````` 582 583Add a new method :meth:`~matplotlib.backends.backend_pdf.PdfPages.attach_note` 584to the PdfPages class, allowing the 585attachment of simple text notes to pages in a multi-page pdf of 586figures. The new note is visible in the list of pdf annotations in a 587viewer that has this facility (Adobe Reader, OSX Preview, Skim, 588etc.). Per default the note itself is kept off-page to prevent it to 589appear in print-outs. 590 591`PdfPages.attach_note` needs to be called before `savefig()` in order to be 592added to the correct figure. 593 594Updated fignum_exists to take figure name 595````````````````````````````````````````` 596 597Added the ability to check the existence of a figure using its name 598instead of just the figure number. 599Example:: 600 601 figure('figure') 602 fignum_exists('figure') #true 603 604 605ToolManager 606----------- 607 608Federico Ariza wrote the new `~matplotlib.backend_managers.ToolManager` 609that comes as replacement for `NavigationToolbar2` 610 611`ToolManager` offers a new way of looking at the user interactions 612with the figures. Before we had the `NavigationToolbar2` with its own 613tools like `zoom/pan/home/save/...` and also we had the shortcuts like 614`yscale/grid/quit/....` `Toolmanager` relocate all those actions as 615`Tools` (located in `~matplotlib.backend_tools`), and defines a way to 616`access/trigger/reconfigure` them. 617 618The `Toolbars` are replaced for `ToolContainers` that are just GUI 619interfaces to `trigger` the tools. But don't worry the default 620backends include a `ToolContainer` called `toolbar` 621 622 623.. note:: 624 At the moment, we release this primarily for feedback purposes and should 625 be treated as experimental until further notice as API changes will occur. 626 For the moment the `ToolManager` works only with the `GTK3` and `Tk` backends. 627 Make sure you use one of those. 628 Port for the rest of the backends is comming soon. 629 630 To activate the `ToolManager` include the following at the top of your file :: 631 632 >>> matplotlib.rcParams['toolbar'] = 'toolmanager' 633 634 635Interact with the ToolContainer 636``````````````````````````````` 637 638The most important feature is the ability to easily reconfigure the ToolContainer (aka toolbar). 639For example, if we want to remove the "forward" button we would just do. :: 640 641 >>> fig.canvas.manager.toolmanager.remove_tool('forward') 642 643Now if you want to programmatically trigger the "home" button :: 644 645 >>> fig.canvas.manager.toolmanager.trigger_tool('home') 646 647 648New Tools for ToolManager 649````````````````````````` 650 651It is possible to add new tools to the ToolManager 652 653A very simple tool that prints "You're awesome" would be:: 654 655 from matplotlib.backend_tools import ToolBase 656 class AwesomeTool(ToolBase): 657 def trigger(self, *args, **kwargs): 658 print("You're awesome") 659 660 661To add this tool to `ToolManager` 662 663 >>> fig.canvas.manager.toolmanager.add_tool('Awesome', AwesomeTool) 664 665If we want to add a shortcut ("d") for the tool 666 667 >>> fig.canvas.manager.toolmanager.update_keymap('Awesome', 'd') 668 669 670To add it to the toolbar inside the group 'foo' 671 672 >>> fig.canvas.manager.toolbar.add_tool('Awesome', 'foo') 673 674 675There is a second class of tools, "Toggleable Tools", this are almost 676the same as our basic tools, just that belong to a group, and are 677mutually exclusive inside that group. For tools derived from 678`ToolToggleBase` there are two basic methods `enable` and `disable` 679that are called automatically whenever it is toggled. 680 681 682A full example is located in :doc:`/gallery/user_interfaces/toolmanager_sgskip` 683 684 685cbook.is_sequence_of_strings recognizes string objects 686------------------------------------------------------ 687 688This is primarily how pandas stores a sequence of strings :: 689 690 import pandas as pd 691 import matplotlib.cbook as cbook 692 693 a = np.array(['a', 'b', 'c']) 694 print(cbook.is_sequence_of_strings(a)) # True 695 696 a = np.array(['a', 'b', 'c'], dtype=object) 697 print(cbook.is_sequence_of_strings(a)) # True 698 699 s = pd.Series(['a', 'b', 'c']) 700 print(cbook.is_sequence_of_strings(s)) # True 701 702Previously, the last two prints returned false. 703 704 705New ``close-figs`` argument for plot directive 706---------------------------------------------- 707 708Matplotlib has a sphinx extension ``plot_directive`` that creates plots for 709inclusion in sphinx documents. Matplotlib 1.5 adds a new option to the plot 710directive - ``close-figs`` - that closes any previous figure windows before 711creating the plots. This can help avoid some surprising duplicates of plots 712when using ``plot_directive``. 713 714Support for URL string arguments to ``imread`` 715---------------------------------------------- 716 717The :func:`~matplotlib.pyplot.imread` function now accepts URL strings that 718point to remote PNG files. This circumvents the generation of a 719HTTPResponse object directly. 720 721Display hook for animations in the IPython notebook 722--------------------------------------------------- 723 724`~matplotlib.animation.Animation` instances gained a ``_repr_html_`` method 725to support inline display of animations in the notebook. The method used 726to display is controlled by the ``animation.html`` rc parameter, which 727currently supports values of ``none`` and ``html5``. ``none`` is the 728default, performing no display. ``html5`` converts the animation to an 729h264 encoded video, which is embedded directly in the notebook. 730 731Users not wishing to use the ``_repr_html_`` display hook can also manually 732call the `to_html5_video` method to get the HTML and display using 733IPython's ``HTML`` display class:: 734 735 from IPython.display import HTML 736 HTML(anim.to_html5_video()) 737 738Prefixed pkg-config for building 739-------------------------------- 740 741Handling of `pkg-config` has been fixed in so far as it is now 742possible to set it using the environment variable `PKG_CONFIG`. This 743is important if your toolchain is prefixed. This is done in a simpilar 744way as setting `CC` or `CXX` before building. An example follows. 745 746 export PKG_CONFIG=x86_64-pc-linux-gnu-pkg-config 747