Skip to content

Commit 61fa0d9

Browse files
committed
DOC: Introduce backend versions
Closes matplotlib#30559.
1 parent dedfe9b commit 61fa0d9

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

galleries/users_explain/figure/backends.rst

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,42 @@ backend, use ``module://name.of.the.backend`` as the backend name, e.g.
253253

254254
Information for backend implementers is available at :ref:`writing_backend_interface`.
255255

256+
Backend API versions
257+
--------------------
258+
Matplotlib commits to maintain strong backward compatibility on backends. Nevertheless,
259+
we want to be able to evolve the backend API to support new features. Versioning the
260+
backend API allows us to talk to backends through the API version they understand.
261+
262+
Backends should define a constant ``MATPLOTLIB_BACKEND_API_VERSION`` in their modules.
263+
A missing constant is interpreted as version ``"1.0"``.
264+
265+
.. note::
266+
267+
The variable ``MATPLOTLIB_BACKEND_API_VERSION`` is currently unused, because the
268+
detection of API version 1.1 is handled via introspection. We nevertheless
269+
encourage third-party backends to start providing this variable as a communication
270+
of intent.
271+
272+
The following backend API versions exist
273+
274+
.. list-table::
275+
:header-rows: 1
276+
277+
* - API version
278+
- Supported since
279+
- Description
280+
* - 1.0
281+
- matplotlib 1.0
282+
- The backend API has been unmodified for a long time. We retroactively declare
283+
this the backend version 1.0
284+
* - 1.1
285+
- matplotlib 3.11
286+
- `.RendererBase.draw_path_collection` gained a new optional parameter
287+
*hatchcolor*.
288+
289+
There is currently no plan to remove support for older API versions.
290+
291+
256292
.. _figures-not-showing:
257293

258294
Debugging the figure windows not showing

0 commit comments

Comments
 (0)