Skip to content

Commit ebdd7df

Browse files
authored
Merge pull request matplotlib#16740 from QuLogic/figure-dpi
Fix type of `dpi` in docstrings.
2 parents 2883c90 + a6ad92f commit ebdd7df

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

doc/devel/documenting_mpl.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -498,9 +498,9 @@ effect.
498498
.. code-block:: rst
499499
500500
Prefer:
501-
dpi : int, default: :rc:`figure.dpi`
501+
dpi : float, default: :rc:`figure.dpi`
502502
over:
503-
dpi : int, default: None
503+
dpi : float, default: None
504504
505505
Prefer:
506506
textprops : dict, optional

lib/matplotlib/animation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def setup(self, fig, outfile, dpi=None):
208208
The figure object that contains the information for frames.
209209
outfile : str
210210
The filename of the resulting movie file.
211-
dpi : int, optional, default: ``fig.dpi``
211+
dpi : float, optional, default: ``fig.dpi``
212212
The DPI (or resolution) for the file. This controls the size
213213
in pixels of the resulting movie file.
214214
"""
@@ -434,10 +434,10 @@ def setup(self, fig, outfile, dpi=None, frame_prefix=None,
434434
The figure to grab the rendered frames from.
435435
outfile : str
436436
The filename of the resulting movie file.
437-
dpi : number, optional
437+
dpi : float, optional
438438
The dpi of the output file. This, with the figure size,
439439
controls the size in pixels of the resulting movie file.
440-
Default is fig.dpi.
440+
Default is ``fig.dpi``.
441441
frame_prefix : str, optional
442442
The filename prefix to use for temporary files. If None (the
443443
default), files are written to a temporary directory which is
@@ -981,7 +981,7 @@ class to use, such as 'ffmpeg'.
981981
Movie frame rate (per second). If not set, the frame rate from the
982982
animation's frame interval.
983983
984-
dpi : int, default: :rc:`savefig.dpi`
984+
dpi : float, default: :rc:`savefig.dpi`
985985
Controls the dots per inch for the movie frames. Together with
986986
the figure's size in inches, this controls the size of the movie.
987987

lib/matplotlib/backends/backend_mixed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def __init__(self, figure, width, height, dpi, vector_renderer,
2727
height : scalar
2828
The height of the canvas in logical units
2929
30-
dpi : scalar
30+
dpi : float
3131
The dpi of the canvas
3232
3333
vector_renderer : `matplotlib.backend_bases.RendererBase`

lib/matplotlib/image.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,9 +1493,10 @@ def imsave(fname, arr, vmin=None, vmax=None, cmap=None, format=None,
14931493
origin : {'upper', 'lower'}, default: :rc:`image.origin`
14941494
Indicates whether the ``(0, 0)`` index of the array is in the upper
14951495
left or lower left corner of the axes.
1496-
dpi : int
1496+
dpi : float
14971497
The DPI to store in the metadata of the file. This does not affect the
1498-
resolution of the output image.
1498+
resolution of the output image. Depending on file format, this may be
1499+
rounded to the nearest integer.
14991500
metadata : dict, optional
15001501
Metadata in the image file. The supported keys depend on the output
15011502
format, see the documentation of the respective backends for more

lib/matplotlib/pyplot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ def figure(num=None, # autoincrement if None, else integer from 1-N
470470
figsize : (float, float), default: :rc:`figure.figsize`
471471
Width, height in inches.
472472
473-
dpi : int, default: :rc:`figure.dpi`
473+
dpi : float, default: :rc:`figure.dpi`
474474
The resolution of the figure in dots-per-inch.
475475
476476
facecolor : color, default: :rc:`figure.facecolor`

0 commit comments

Comments
 (0)