Skip to content

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

@22tommibaer01

Description

@22tommibaer01

mplleaflet attribute error with first use

Problem

  • download mplleaflet v. 0.0.5 from conda-forge
  • started a test script like
import matplotlib.pyplot as plt
import mplleaflet

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

  • not a big deal, just one line of code
  • solution by this

Possible Solution

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

Setup

  • conda 4.10.3
  • python 3.8.8
  • matplotlib 3.4.2
  • mplleaflet 0.0.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions