allantools icon indicating copy to clipboard operation
allantools copied to clipboard

Matplotlib Warning: `UserWarning: First parameter to grid() is false, but line properties are supplied. ...`

Open DietBru opened this issue 3 years ago • 1 comments

Hello, when using matplotib 3.4.2, I am getting the warning:

   UserWarning: First parameter to grid() is false, but line properties are supplied. The grid will be enabled.

It is caused by the command

   self.ax.grid(grid, which="minor", ls="-", color='0.65')

from file plot.py, line 95. Replacing it with

    if grid:  # if/else to silence matplotlib warning
        self.ax.grid(grid, which="minor", ls="-", color='0.65')
        self.ax.grid(grid, which="major", ls="-", color='0.25')
    else:
        self.ax.grid(False)

silences this warning. Thanks.

DietBru avatar Jun 11 '21 11:06 DietBru

thanks, I noticed the same warning on a newly installed computer. I guess it is related to a new matplotlib version.

I can make a commit/pull-request with your fixes in a few days - thanks for posting the issue and a proposed fix.

aewallin avatar Jun 14 '21 07:06 aewallin