I am trying to build outlines and previously used the RGB tuple to specify the color (only one for all outlines) - however now I get a ValueError from to_rgba:
ValueError: to_rgba: Invalid rgba arg "1" to_rgb: Invalid rgb arg "1" cannot convert argument to rgb sequence
Here is an example:
import numpy as np import matplotlib.pyplot as plt grid = np.random.random((10,10)) contours = np.linspace(0, 1, 10)
Now it works!
plt.contour(grid, levels = contours, colors = 'r') plt.show()
But it does NOT work!
plt.contour(grid, levels = contours, colors = (1,0,0)) plt.show()
Am I doing something wrong or is this error (/ new feature) in Matplotlib? Thanks.
source share