Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f53ee4d

Browse files
committed
Use shorter float repr in figure options dialog.
On Python3, native float repr is as short as possible. Moreover, no precision is lost as {x,y}lims are already internally represented as numpy floats of the same size as the native floats. See #4839.
1 parent c52ef28 commit f53ee4d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/backends/qt_editor/figureoptions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ def figure_edit(axes, parent=None):
4646
has_curve = len(axes.get_lines()) > 0
4747

4848
# Get / General
49-
xmin, xmax = axes.get_xlim()
50-
ymin, ymax = axes.get_ylim()
49+
xmin, xmax = map(float, axes.get_xlim())
50+
ymin, ymax = map(float, axes.get_ylim())
5151
general = [('Title', axes.get_title()),
5252
sep,
5353
(None, "<b>X-Axis</b>"),

0 commit comments

Comments
 (0)