You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Anscombe example subplots in anscombe.py are correctly generated but there is a warning from matplotlib (3.0.3). For context, the argument to the c parameter is a 3-tuple.
'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.
The call in anscombe.py is
ax.scatter(x, y, c=color)
@DistrictDataLabs/team-oz-maintainers
The text was updated successfully, but these errors were encountered:
@nickpowersys thanks for pointing this out. We just came back from a haitus and still going through our backlog of issues and PRs. We will respond more fully asap. We definitely need to address this as We have several issues about color that are open. #677
This is related to the warning occurring in the examples.ipynb notebook, with any user's experience trying out Anscombe's Quartet, as well as any scatter plots using an RGB cycle from get_color_cycle().
Within anscombe.py, the get_color_cycle() function returns the yellowbrick palette as an RGB cycle.
This is because within get_color_cycle(), the color_palette() function takes the yellowbrick palette, which is in Hex, and converts it to RGB.
The warning would go away if the palette stayed as Hex instead.
For consistency with the current matplotlib and to avoid other warnings associated with RGB, would it make sense to test having color_palette() return Hex values instead of converting to RGB?
This is the relevant section of color_palette():
# Always return in RGB tuple format
try:
palette = map(mpl.colors.colorConverter.to_rgb, palette)
palette = ColorPalette(palette)
except ValueError:
raise YellowbrickValueError(
"Could not generate a palette for %s" % str(palette)
)
nickpowersys
changed the title
Matplotlib warning triggered by scatter plot with x, y arrays of size>1 and 3-tuple for color
Matplotlib>= 2.0 has defaulty property cycle in Hex, while color_palette() and get_color_cycle() return RGB
Jul 17, 2019
nickpowersys
changed the title
Matplotlib>= 2.0 has defaulty property cycle in Hex, while color_palette() and get_color_cycle() return RGB
Matplotlib>= 2.0 has default property cycle in Hex, while color_palette() and get_color_cycle() return RGB
Jul 17, 2019
Example
The Anscombe example subplots in anscombe.py are correctly generated but there is a warning from matplotlib (3.0.3). For context, the argument to the
c
parameter is a 3-tuple.'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.
The call in anscombe.py is
ax.scatter(x, y, c=color)
@DistrictDataLabs/team-oz-maintainers
The text was updated successfully, but these errors were encountered: