Open pskeshu opened 5 years ago
Thank you for reporting this error. It was supposed to be fixed in 0.3.6 but that version was never uploaded to PyPI :disappointed: In any case your issue made me fixed a few other things that did not work with matplotlib 3.0.
Could you please update matplotlib-colorbar
(the new version should be 0.3.7) and try again?
Thank you for the fix! Although the old problem is gone, I'm getting a different error now. :disappointed:
File "/usr/lib/python3.7/site-packages/matplotlib/pyplot.py", line 688, in savefig
res = fig.savefig(*args, **kwargs)
File "/usr/lib/python3.7/site-packages/matplotlib/figure.py", line 2097, in savefig
self.canvas.print_figure(fname, **kwargs)
File "/usr/lib/python3.7/site-packages/matplotlib/backend_bases.py", line 2075, in print_figure
**kwargs)
File "/usr/lib/python3.7/site-packages/matplotlib/backends/backend_agg.py", line 510, in print_png
FigureCanvasAgg.draw(self)
File "/usr/lib/python3.7/site-packages/matplotlib/backends/backend_agg.py", line 402, in draw
self.figure.draw(self.renderer)
File "/usr/lib/python3.7/site-packages/matplotlib/artist.py", line 50, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "/usr/lib/python3.7/site-packages/matplotlib/figure.py", line 1652, in draw
renderer, self, artists, self.suppressComposite)
File "/usr/lib/python3.7/site-packages/matplotlib/image.py", line 138, in _draw_list_compositing_images
a.draw(renderer)
File "/usr/lib/python3.7/site-packages/matplotlib/artist.py", line 50, in draw_wrapper
return draw(artist, renderer, *args, **kwargs)
File "/usr/lib/python3.7/site-packages/matplotlib/axes/_base.py", line 2604, in draw
mimage._draw_list_compositing_images(renderer, self, artists)
File "/usr/lib/python3.7/site-packages/matplotlib/image.py", line 138, in _draw_list_compositing_images
a.draw(renderer)
File "/usr/lib/python3.7/site-packages/matplotlib_colorbar/colorbar.py", line 329, in draw
ticks, ticklabels, offset_string = calculator.calculate_ticks()
File "/usr/lib/python3.7/site-packages/matplotlib_colorbar/colorbar.py", line 174, in calculate_ticks
return self._base._ticker()
TypeError: _ticker() missing 2 required positional arguments: 'locator' and 'formatter'
Can you try updating matplotlib to 3.0.2?
The colorbar looks small, and set_ticks seems to have no effect. :(
The exact same code when run with matplotlib-2.2.0 produces this, which is desirable.
Here's the relevant part of the code
clim = [0.11, 0.15]
cbar_args = {
"length_fraction": 0.25,
"width_fraction": 0.05,
"frameon": False,
"orientation": "vertical",
"ticklocation": "left",
"color": "w",
"sep": 2,
"box_color": "b",
"font_properties" : {"size" : 20}
}
colorbar_1 = Colorbar(img_1,
location='upper right',
**cbar_args)
colorbar_1.set_ticks(clim)
axs[0, 0].add_artist(colorbar_1)
Hi, just wanted to find out if there's a possible way to fix this. I would be happy to fix the problem if you point me at the right direction.
Could you try again with the new version (0.4.0)? I think matplotlib 3.x changed the way the color bar is calculated and broke matplotlib-colorbar.
System info: