pdvega
pdvega copied to clipboard
How to turn off legend when there are too many columns?
Trying to plot a df with 25 columns using the vgplot method results in a legend that extends the graph vertically. How can we implement the pandas plotting behavior of:
df.plot(legend=False)
That would require setting the 'legend' property of the associated encoding to None:
data = pd.DataFrame({'x': np.arange(5),
'y': np.arange(0, 10, 2)})
plot = data.vgplot.line()
plot.spec['encoding']['color']['legend'] = None
plot.display

We could definitely tie this to a legend=False argument in the plot methods.