jwass / mplleaflet

Easily convert matplotlib plots from Python into interactive Leaflet web maps.
BSD 3-Clause "New" or "Revised" License
521 stars 76 forks source link

mplleaflet AttributeError: 'XAxis' object has no attribute '_gridOnMajor' #80

Open 22tommibaer01 opened 3 years ago

22tommibaer01 commented 3 years ago

mplleaflet attribute error with first use

Problem

long=[72.12,72.012,72.25,72.0254,73] #data (random) lat=[50,50.21,51.1263,52.4174,53.21]

ax=plt.plot(long, lat) #matplotlib

mplleaflet.display() #mplleaflet


- not working; Error:

file "C:\Anaconda\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'



### Solution
<!--- !!! OBLIGATORY !!! -->
<!--- !!! Delete words from header according to type of issue !!! -->
<!--- Give a clear and concise description of what should be accomplished. -->

- not a big deal, just one line of code
- solution by [this](https://github.com/plotly/plotly.py/issues/2913)

### Possible Solution
<!--- OPTIONAL -->

- go to line and file from the error message `(def get_grid_style)`
- change `axis._gridOnMajor` to `axis._major_tick_kw['gridOn']`
- finish 

### Setup
<!--- !!! OBLIGATORY !!! -->
<!--- !!! Delete words from header according to type of issue !!! -->
<!--- Give a clear and concise description of what should be accomplished. -->
 - conda 4.10.3
 - python 3.8.8
 - matplotlib 3.4.2
 - mplleaflet 0.0.5