1
+ =============================================
2
+ What's new in Matplotlib 3.10.0 (Dec 14, 2024)
3
+ =============================================
4
+
5
+ For a list of all of the issues and pull requests since the last revision, see the
6
+ :ref: `github-stats `.
7
+
8
+ .. contents :: Table of Contents
9
+ :depth: 4
10
+
11
+ .. toctree ::
12
+ :maxdepth: 4
13
+
14
+ Accessible Colors
15
+ =================
16
+
17
+
1
18
New more-accessible color cycle
2
19
-------------------------------
3
20
@@ -43,6 +60,12 @@ colour maps version 8.0.1 (DOI: https://doi.org/10.5281/zenodo.1243862).
43
60
ax[1].imshow(img, cmap=plt.cm.managua)
44
61
ax[2].imshow(img, cmap=plt.cm.vanimo)
45
62
63
+
64
+
65
+ Plotting and Annotation improvements
66
+ ====================================
67
+
68
+
46
69
Specifying a single color in ``contour `` and ``contourf ``
47
70
---------------------------------------------------------
48
71
@@ -65,66 +88,6 @@ may be passed.
65
88
66
89
plt.show()
67
90
68
- Exception handling control
69
- --------------------------
70
-
71
- The exception raised when an invalid keyword parameter is passed now includes
72
- that parameter name as the exception's ``name `` property. This provides more
73
- control for exception handling:
74
-
75
-
76
- .. code-block :: python
77
-
78
- import matplotlib.pyplot as plt
79
-
80
- def wobbly_plot (args , ** kwargs ):
81
- w = kwargs.pop(' wobble_factor' , None )
82
-
83
- try :
84
- plt.plot(args, ** kwargs)
85
- except AttributeError as e:
86
- raise AttributeError (f ' wobbly_plot does not take parameter { e.name} ' ) from e
87
-
88
-
89
- wobbly_plot([0 , 1 ], wibble_factor = 5 )
90
-
91
- .. code-block ::
92
-
93
- AttributeError: wobbly_plot does not take parameter wibble_factor
94
-
95
- Preliminary support for free-threaded CPython 3.13
96
- --------------------------------------------------
97
-
98
- Matplotlib 3.10 has preliminary support for the free-threaded build of CPython 3.13. See
99
- https://py-free-threading.github.io, `PEP 703 <https://peps.python.org/pep-0703/ >`_ and
100
- the `CPython 3.13 release notes
101
- <https://docs.python.org/3.13/whatsnew/3.13.html#free-threaded-cpython> `_ for more detail
102
- about free-threaded Python.
103
-
104
- Support for free-threaded Python does not mean that Matplotlib is wholly thread safe. We
105
- expect that use of a Figure within a single thread will work, and though input data is
106
- usually copied, modification of data objects used for a plot from another thread may
107
- cause inconsistencies in cases where it is not. Use of any global state (such as the
108
- ``pyplot `` module) is highly discouraged and unlikely to work consistently. Also note
109
- that most GUI toolkits expect to run on the main thread, so interactive usage may be
110
- limited or unsupported from other threads.
111
-
112
- If you are interested in free-threaded Python, for example because you have a
113
- multiprocessing-based workflow that you are interested in running with Python threads, we
114
- encourage testing and experimentation. If you run into problems that you suspect are
115
- because of Matplotlib, please open an issue, checking first if the bug also occurs in the
116
- “regular” non-free-threaded CPython 3.13 build.
117
-
118
- Increased Figure limits with Agg renderer
119
- -----------------------------------------
120
-
121
- Figures using the Agg renderer are now limited to 2**23 pixels in each
122
- direction, instead of 2**16. Additionally, bugs that caused artists to not
123
- render past 2**15 pixels horizontally have been fixed.
124
-
125
- Note that if you are using a GUI backend, it may have its own smaller limits
126
- (which may themselves depend on screen size.)
127
-
128
91
Vectorized ``hist `` style parameters
129
92
------------------------------------
130
93
@@ -259,39 +222,6 @@ Subfigures are now added in row-major order
259
222
ax.set_yticks([])
260
223
plt.show()
261
224
262
- ``svg.id `` rcParam
263
- ------------------
264
-
265
- :rc: `svg.id ` lets you insert an ``id `` attribute into the top-level ``<svg> `` tag.
266
-
267
- e.g. ``rcParams["svg.id"] = "svg1" `` results in
268
- default), no ``id `` tag is included
269
-
270
- .. code-block :: XML
271
-
272
- <svg
273
- xmlns:xlink="http://www.w3.org/1999/xlink"
274
- width="50pt" height="50pt"
275
- viewBox="0 0 50 50"
276
- xmlns="http://www.w3.org/2000/svg"
277
- version="1.1"
278
- id="svg1"
279
- ></svg>
280
-
281
- This is useful if you would like to link the entire matplotlib SVG file within
282
- another SVG file with the ``<use> `` tag.
283
-
284
- .. code-block :: XML
285
-
286
- <svg>
287
- <use
288
- width="50" height="50"
289
- xlink:href="mpl.svg#svg1" id="use1"
290
- x="0" y="0"
291
- /></svg>
292
-
293
- Where the ``#svg1 `` indicator will now refer to the top level ``<svg> `` tag, and
294
- will hence result in the inclusion of the entire file.
295
225
296
226
``boxplot `` and ``bxp `` orientation parameter
297
227
---------------------------------------------
@@ -361,6 +291,11 @@ the ``set_data`` method, enabling e.g. resampling
361
291
coll.set_data(t, - t** 4 , t** 4 )
362
292
fig.savefig(" after.png" )
363
293
294
+
295
+ 3D plotting improvements
296
+ ========================
297
+
298
+
364
299
Fill between 3D lines
365
300
---------------------
366
301
@@ -471,6 +406,108 @@ view box is a limitation of the current renderer.
471
406
ax.legend(['axlim_clip=False (default)', 'axlim_clip=True'])
472
407
473
408
409
+ Preliminary support for free-threaded CPython 3.13
410
+ ==================================================
411
+
412
+ Matplotlib 3.10 has preliminary support for the free-threaded build of CPython 3.13. See
413
+ https://py-free-threading.github.io, `PEP 703 <https://peps.python.org/pep-0703/ >`_ and
414
+ the `CPython 3.13 release notes
415
+ <https://docs.python.org/3.13/whatsnew/3.13.html#free-threaded-cpython> `_ for more detail
416
+ about free-threaded Python.
417
+
418
+ Support for free-threaded Python does not mean that Matplotlib is wholly thread safe. We
419
+ expect that use of a Figure within a single thread will work, and though input data is
420
+ usually copied, modification of data objects used for a plot from another thread may
421
+ cause inconsistencies in cases where it is not. Use of any global state (such as the
422
+ ``pyplot `` module) is highly discouraged and unlikely to work consistently. Also note
423
+ that most GUI toolkits expect to run on the main thread, so interactive usage may be
424
+ limited or unsupported from other threads.
425
+
426
+ If you are interested in free-threaded Python, for example because you have a
427
+ multiprocessing-based workflow that you are interested in running with Python threads, we
428
+ encourage testing and experimentation. If you run into problems that you suspect are
429
+ because of Matplotlib, please open an issue, checking first if the bug also occurs in the
430
+ “regular” non-free-threaded CPython 3.13 build.
431
+
432
+
433
+
434
+ Other Improvements
435
+ ==================
436
+
437
+ ``svg.id `` rcParam
438
+ ------------------
439
+
440
+ :rc: `svg.id ` lets you insert an ``id `` attribute into the top-level ``<svg> `` tag.
441
+
442
+ e.g. ``rcParams["svg.id"] = "svg1" `` results in
443
+
444
+ .. code-block :: XML
445
+
446
+ <svg
447
+ xmlns:xlink="http://www.w3.org/1999/xlink"
448
+ width="50pt" height="50pt"
449
+ viewBox="0 0 50 50"
450
+ xmlns="http://www.w3.org/2000/svg"
451
+ version="1.1"
452
+ id="svg1"
453
+ ></svg>
454
+
455
+ This is useful if you would like to link the entire matplotlib SVG file within
456
+ another SVG file with the ``<use> `` tag.
457
+
458
+ .. code-block :: XML
459
+
460
+ <svg>
461
+ <use
462
+ width="50" height="50"
463
+ xlink:href="mpl.svg#svg1" id="use1"
464
+ x="0" y="0"
465
+ /></svg>
466
+
467
+ Where the ``#svg1 `` indicator will now refer to the top level ``<svg> `` tag, and
468
+ will hence result in the inclusion of the entire file.
469
+
470
+ By default, no ``id `` tag is included.
471
+
472
+ Exception handling control
473
+ --------------------------
474
+
475
+ The exception raised when an invalid keyword parameter is passed now includes
476
+ that parameter name as the exception's ``name `` property. This provides more
477
+ control for exception handling:
478
+
479
+
480
+ .. code-block :: python
481
+
482
+ import matplotlib.pyplot as plt
483
+
484
+ def wobbly_plot (args , ** kwargs ):
485
+ w = kwargs.pop(' wobble_factor' , None )
486
+
487
+ try :
488
+ plt.plot(args, ** kwargs)
489
+ except AttributeError as e:
490
+ raise AttributeError (f ' wobbly_plot does not take parameter { e.name} ' ) from e
491
+
492
+
493
+ wobbly_plot([0 , 1 ], wibble_factor = 5 )
494
+
495
+ .. code-block ::
496
+
497
+ AttributeError: wobbly_plot does not take parameter wibble_factor
498
+
499
+ Increased Figure limits with Agg renderer
500
+ -----------------------------------------
501
+
502
+ Figures using the Agg renderer are now limited to 2**23 pixels in each
503
+ direction, instead of 2**16. Additionally, bugs that caused artists to not
504
+ render past 2**15 pixels horizontally have been fixed.
505
+
506
+ Note that if you are using a GUI backend, it may have its own smaller limits
507
+ (which may themselves depend on screen size.)
508
+
509
+
510
+
474
511
Miscellaneous Changes
475
512
---------------------
476
513
0 commit comments