Seaborn: Boxenplot warnings in the example

Created on 13 Dec 2018  路  8Comments  路  Source: mwaskom/seaborn

>>> iris = sns.load_dataset("iris")
>>> ax = sns.boxenplot(data=iris, orient="h", palette="Set2")

When running the example above, I got the warning message below:

'c' argument looks like a single numeric RGB or RGBA sequence, which should be avoided as value-mapping will have precedence in case its length matches with 'x' & 'y'.  Please use a 2-D array with a single row if you really want to specify the same RGB or RGBA value for all points.
'c' argument looks like a single numeric RGB or RGBA sequence, which should be avoided as value-mapping will have precedence in case its length matches with 'x' & 'y'.  Please use a 2-D array with a single row if you really want to specify the same RGB or RGBA value for all points.
'c' argument looks like a single numeric RGB or RGBA sequence, which should be avoided as value-mapping will have precedence in case its length matches with 'x' & 'y'.  Please use a 2-D array with a single row if you really want to specify the same RGB or RGBA value for all points.
'c' argument looks like a single numeric RGB or RGBA sequence, which should be avoided as value-mapping will have precedence in case its length matches with 'x' & 'y'.  Please use a 2-D array with a single row if you really want to specify the same RGB or RGBA value for all points.

It does not return any exception, but I found it irritating as it appears everytime I run the code. I would like to suppress all warning messages as sometimes it could be important, but I do not really understand for this particular.

Most helpful comment

As a workaround you can reduce the level of the axis logger to error:

from matplotlib.axes._axes import _log as matplotlib_axes_logger
matplotlib_axes_logger.setLevel('ERROR')

All 8 comments

Running into the same issue, can't seem to avoid or suppress this warning. I've tried passing colors manually but it still displays the same text every time the plot is run.

I'm seeing this issue too. It makes boxenplots very hard to use in Jupyter as the warning is generated multiple times per plot. Currently I don't know a better workaround than suppressing all warnings for that notebook cell.

I'm guessing it might be related to changes in Matplotlib. I can see a similar (now fixed) issue referenced in JuliaPlots: https://github.com/JuliaPlots/Plots.jl/issues/1799

Same problem here. I wonder if this is related to #1682 somehow.

My Matplotlib version is 3.0.0

I'm also experiencing this issue with latest versions of matplotlib and seaborn.

As a workaround you can reduce the level of the axis logger to error:

from matplotlib.axes._axes import _log as matplotlib_axes_logger
matplotlib_axes_logger.setLevel('ERROR')

Thank you!

Thank you rene-rex

For those manually setting the colors, it seems that encasing the color in [brackets] solves this problem.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ConstantinoSchillebeeckx picture ConstantinoSchillebeeckx  路  4Comments

chanshing picture chanshing  路  3Comments

phantom0301 picture phantom0301  路  3Comments

alexpetralia picture alexpetralia  路  3Comments

stonebig picture stonebig  路  4Comments