Skip to content

AttributeError with big float Value(s) #1828

@ElricleNecro

Description

@ElricleNecro

When I use some important value in my plot, i get the error :

Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python3.3/tkinter/__init__.py", line 1442, in __call__
    return self.func(*args)
  File "/usr/lib/python3.3/site-packages/matplotlib/backends/backend_tkagg.py", line 276, in resize
    self.show()
  File "/usr/lib/python3.3/site-packages/matplotlib/backends/backend_tkagg.py", line 348, in draw
    FigureCanvasAgg.draw(self)
  File "/usr/lib/python3.3/site-packages/matplotlib/backends/backend_agg.py", line 439, in draw
    self.figure.draw(self.renderer)
  File "/usr/lib/python3.3/site-packages/matplotlib/artist.py", line 55, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib/python3.3/site-packages/matplotlib/figure.py", line 1000, in draw
    func(*args)
  File "/usr/lib/python3.3/site-packages/matplotlib/artist.py", line 55, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib/python3.3/site-packages/matplotlib/axes.py", line 2088, in draw
    a.draw(renderer)
  File "/usr/lib/python3.3/site-packages/matplotlib/artist.py", line 55, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib/python3.3/site-packages/matplotlib/axis.py", line 1049, in draw
    ticks_to_draw = self._update_ticks(renderer)
  File "/usr/lib/python3.3/site-packages/matplotlib/axis.py", line 936, in _update_ticks
    tick_tups = [t for t in self.iter_ticks()]
  File "/usr/lib/python3.3/site-packages/matplotlib/axis.py", line 936, in <listcomp>
    tick_tups = [t for t in self.iter_ticks()]
  File "/usr/lib/python3.3/site-packages/matplotlib/axis.py", line 882, in iter_ticks
    self.major.formatter.set_locs(majorLocs)
  File "/usr/lib/python3.3/site-packages/matplotlib/ticker.py", line 483, in set_locs
    self._set_format(vmin, vmax)
  File "/usr/lib/python3.3/site-packages/matplotlib/ticker.py", line 550, in _set_format
    if np.abs(locs - np.round(locs, decimals=sigfigs)).max() < thresh:
  File "/usr/lib/python3.3/site-packages/numpy/core/fromnumeric.py", line 2402, in round_
    return round(decimals, out)
AttributeError: 'float' object has no attribute 'rint'

Here is a little piece of code which reproduces the error :

from matplotlib import pyplot as plt
import numpy as np

x = np.arange(0, 3, 1)
y = x*1e35

print(y)

plt.ioff()
plt.plot(x, y)
plt.show()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions