I'm using xarray.DataArray.plot
to plot my values, such as:
In [26]: cla()
In [27]: da = xarray.DataArray(arange(6*5).reshape(6,5), dims=("a", "b"), coords={"a": range(6), "b": range(5), "c": ("a", range(6))})
In [28]: da["c"].plot(label="a")
Out[28]: [<matplotlib.lines.Line2D at 0x7fef942e8b38>]
In [29]: da["c"].plot(label=None)
Out[29]: [<matplotlib.lines.Line2D at 0x7fef94279dd8>]
In [30]: legend()
Out[30]: <matplotlib.legend.Legend at 0x7fef942cba20>
My desired effect is that the da["c"].plot(label=None)
does not result in any labelled line. However, xarray
appears to give it a label "c"
in the resulting plot, whereby it appears in the legend. How can I suppress this?