File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change
1
+ Plot Directive now can make responsive images with "srcset"
2
+ -----------------------------------------------------------
3
+
4
+ The plot sphinx directive (``matplotlib.sphinxext.plot_directive ``, invoked in
5
+ rst as ``.. plot:: ``) can be configured to automatically make higher res
6
+ figures and add these to the the built html docs. In ``conf.py ``::
7
+
8
+ extensions = [
9
+ ...
10
+ 'matplotlib.sphinxext.plot_directive',
11
+ 'matplotlib.sphinxext.figmpl_directive',
12
+ ...]
13
+
14
+ plot_srcset = '2x'
15
+
16
+ will make png files with double the resolution for hiDPI displays. Resulting
17
+ html files will have image entries like::
18
+
19
+ <img src="../_images/nestedpage-index-2.png" style="" srcset="../_images/nestedpage-index-2.png, ../_images/nestedpage-index-2.2x.png 2.00x" alt="" class="plot-directive "/>
You can’t perform that action at this time.
0 commit comments