MCPcopy
hub / github.com/pydata/xarray / test_2d_line_accepts_legend_kw

Method test_2d_line_accepts_legend_kw

xarray/tests/test_plot.py:329–337  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

327 self.darray[:, :, 0].plot.line(x="dim_1", y="dim_0", hue="dim_1")
328
329 def test_2d_line_accepts_legend_kw(self) -> None:
330 self.darray[:, :, 0].plot.line(x="dim_0", add_legend=False)
331 assert not plt.gca().get_legend()
332 plt.cla()
333 self.darray[:, :, 0].plot.line(x="dim_0", add_legend=True)
334 legend = plt.gca().get_legend()
335 assert legend is not None
336 # check whether legend title is set
337 assert legend.get_title().get_text() == "dim_1"
338
339 def test_2d_line_accepts_x_kw(self) -> None:
340 self.darray[:, :, 0].plot.line(x="dim_0")

Callers

nothing calls this directly

Calls 1

lineMethod · 0.45

Tested by

no test coverage detected