Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo fails to run due to AttributeError #3

Closed
lmocsi opened this issue Mar 10, 2021 · 3 comments
Closed

Demo fails to run due to AttributeError #3

lmocsi opened this issue Mar 10, 2021 · 3 comments

Comments

@lmocsi
Copy link

lmocsi commented Mar 10, 2021

The "Simple example for showing a track in a map, colored by heart rate" demo fails to run on my gpx file (exported from Garmin Connect), with the following error:
Traceback (most recent call last):
File "b.py", line 10, in
save_map(fig, 'test-{}.html'.format(i))
File "C:\Program Files\Python37\lib\site-packages\gpxplotter\mplplotting.py", line 420, in save_map
mplleaflet.show(path=name, fig=fig, tiles=tile)
File "C:\Program Files\Python37\lib\site-packages\mplleaflet_display.py", line 180, in show
save_html(fig, fileobj=f, **kwargs)
File "C:\Program Files\Python37\lib\site-packages\mplleaflet_display.py", line 131, in save_html
html = fig_to_html(fig, **kwargs)
File "C:\Program Files\Python37\lib\site-packages\mplleaflet_display.py", line 84, in fig_to_html
exporter.run(fig)
File "C:\Program Files\Python37\lib\site-packages\mplleaflet\mplexporter\exporter.py", line 51, in run
self.crawl_fig(fig)
File "C:\Program Files\Python37\lib\site-packages\mplleaflet\mplexporter\exporter.py", line 118, in crawl_fig
self.crawl_ax(ax)
File "C:\Program Files\Python37\lib\site-packages\mplleaflet\mplexporter\exporter.py", line 123, in crawl_ax
props=utils.get_axes_properties(ax)):
File "C:\Program Files\Python37\lib\site-packages\mplleaflet\mplexporter\utils.py", line 267, in get_axes_properties
'axes': [get_axis_properties(ax.xaxis),
File "C:\Program Files\Python37\lib\site-packages\mplleaflet\mplexporter\utils.py", line 231, in get_axis_properties
props['grid'] = get_grid_style(axis)
File "C:\Program Files\Python37\lib\site-packages\mplleaflet\mplexporter\utils.py", line 241, in get_grid_style
if axis._gridOnMajor and len(gridlines) > 0:
AttributeError: 'XAxis' object has no attribute '_gridOnMajor'

@andersle
Copy link
Owner

This one seems to be related to this error in mplleaflet for recent versions of matplotlib. I do not have a quick fix for this (other than downgrading matplotlib), but I will see if I can switch from mplleaftlet to something else.

@andersle
Copy link
Owner

(Swapping from mplleaflet to folium will be done in #4)

@andersle
Copy link
Owner

Closed by #4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants