159
159
from matplotlib import _pylab_helpers , cbook
160
160
161
161
matplotlib .use ("agg" )
162
- align = Image .align
162
+ align = cbook .deprecated (
163
+ "3.4" , alternative = "docutils.parsers.rst.directives.images.Image.align" )(
164
+ Image .align )
163
165
164
166
__version__ = 2
165
167
@@ -191,11 +193,6 @@ def _option_format(arg):
191
193
return directives .choice (arg , ('python' , 'doctest' ))
192
194
193
195
194
- def _option_align (arg ):
195
- return directives .choice (arg , ("top" , "middle" , "bottom" , "left" , "center" ,
196
- "right" ))
197
-
198
-
199
196
def mark_plot_labels (app , document ):
200
197
"""
201
198
To make plots referenceable, we need to move the reference from the
@@ -238,7 +235,7 @@ class PlotDirective(Directive):
238
235
'height' : directives .length_or_unitless ,
239
236
'width' : directives .length_or_percentage_or_unitless ,
240
237
'scale' : directives .nonnegative_int ,
241
- 'align' : _option_align ,
238
+ 'align' : Image . align ,
242
239
'class' : directives .class_option ,
243
240
'include-source' : _option_boolean ,
244
241
'format' : _option_format ,
@@ -258,7 +255,6 @@ def run(self):
258
255
259
256
260
257
def setup (app ):
261
- import matplotlib
262
258
setup .app = app
263
259
setup .config = app .config
264
260
setup .confdir = app .confdir
0 commit comments