Skip to content

Commit e59811f

Browse files
committed
API: rename registry module to global_figures
1 parent fecb3c0 commit e59811f

File tree

3 files changed

+28
-28
lines changed

3 files changed

+28
-28
lines changed

docs/source/api.rst

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Globally managed
9696
----------------
9797

9898

99-
.. automodule:: mpl_gui.registry
99+
.. automodule:: mpl_gui.global_figures
100100
:no-undoc-members:
101101

102102

@@ -108,9 +108,9 @@ Create Figures and Axes
108108
:toctree: _as_gen
109109
:nosignatures:
110110

111-
mpl_gui.registry.figure
112-
mpl_gui.registry.subplots
113-
mpl_gui.registry.subplot_mosaic
111+
mpl_gui.global_figures.figure
112+
mpl_gui.global_figures.subplots
113+
mpl_gui.global_figures.subplot_mosaic
114114

115115

116116
Access managed figures
@@ -121,7 +121,7 @@ Access managed figures
121121
:toctree: _as_gen
122122
:nosignatures:
123123

124-
mpl_gui.registry.by_label
124+
mpl_gui.global_figures.by_label
125125

126126

127127
Show and close managed Figures
@@ -134,10 +134,10 @@ Show and close managed Figures
134134

135135

136136

137-
mpl_gui.registry.show
138-
mpl_gui.registry.show_all
139-
mpl_gui.registry.close_all
140-
mpl_gui.registry.close
137+
mpl_gui.global_figures.show
138+
mpl_gui.global_figures.show_all
139+
mpl_gui.global_figures.close_all
140+
mpl_gui.global_figures.close
141141

142142

143143
Interactivity
@@ -148,6 +148,6 @@ Interactivity
148148
:nosignatures:
149149

150150

151-
mpl_gui.registry.ion
152-
mpl_gui.registry.ioff
153-
mpl_gui.registry.is_interactive
151+
mpl_gui.global_figures.ion
152+
mpl_gui.global_figures.ioff
153+
mpl_gui.global_figures.is_interactive

docs/source/index.rst

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ Globally Managed Figures
5050
========================
5151

5252

53-
The `mpl_gui.registry` module provides a direct analogy to the
53+
The `mpl_gui.global_figures` module provides a direct analogy to the
5454
`matplotlib.pyplot` behavior of having a global registry of figures. Thus, any
55-
figures created via the functions in `.registry` will remain alive until they
55+
figures created via the functions in `.global_figures` will remain alive until they
5656
have been cleared from the registry (and the user has dropped all other
5757
references). While it can be convenient, it carries with it the risk inherent
5858
in any use of global state.
@@ -61,23 +61,23 @@ The `matplotlib.pyplot` API related to figure creation, showing, and closing is
6161

6262
::
6363

64-
import mpl_gui.registry as reg
64+
import mpl_gui.global_figures as gfigs
6565

66-
fig = reg.figure()
67-
fig, ax = reg.subplots()
68-
fig, axd = reg.subplot_mosaic('AA\nCD')
66+
fig = gfigs.figure()
67+
fig, ax = gfigs.subplots()
68+
fig, axd = gfigs.subplot_mosaic('AA\nCD')
6969

70-
reg.show(block=True) # blocks until all figures are closed
71-
reg.show(block=True, timeout=1000) # blocks for up to 1s or all figures are closed
72-
reg.show(block=False) # does not block
73-
reg.show() # depends on if in "interacitve mode"
70+
gfigs.show(block=True) # blocks until all figures are closed
71+
gfigs.show(block=True, timeout=1000) # blocks for up to 1s or all figures are closed
72+
gfigs.show(block=False) # does not block
73+
gfigs.show() # depends on if in "interacitve mode"
7474

75-
reg.ion() # turn on interactive mode
76-
reg.ioff() # turn off interactive mode
77-
reg.is_interactive() # query interactive state
75+
gfigs.ion() # turn on interactive mode
76+
gfigs.ioff() # turn off interactive mode
77+
gfigs.is_interactive() # query interactive state
7878

79-
reg.close('all') # close all open figures
80-
reg.close(fig) # close a particular figure
79+
gfigs.close('all') # close all open figures
80+
gfigs.close(fig) # close a particular figure
8181

8282

8383

@@ -146,7 +146,7 @@ This will create 3 figures and block on ``__exit__``. The blocking
146146
behavior depends on `~mpl_gui.is_interactive()` (and follow the behavior of
147147
`.display` and `.FigureRegistry.show` can explicitly controlled via the *block* keyword argument).
148148

149-
The `.registry` module is implemented by having a singleton `.FigureRegistry`
149+
The `.global_figures` module is implemented by having a singleton `.FigureRegistry`
150150
at the module level.
151151

152152

File renamed without changes.

0 commit comments

Comments
 (0)