pyvista.ChartMPL.legend_visible#

property ChartMPL.legend_visible[ソース]#

チャートの凡例の表示を返すか設定します.

カスタムラベル付きのmatplotlibチャートを作成し,凡例を表示します.

>>> import pyvista as pv
>>> import matplotlib.pyplot as plt
>>> f, ax = plt.subplots()
>>> _ = ax.plot([0, 1, 2], [2, 1, 3], label="Line")
>>> _ = ax.scatter([0, 1, 2], [3, 2, 1], label="Points")
>>> chart = pv.ChartMPL(f)
>>> chart.legend_visible = True
>>> chart.show()
../../../../_images/pyvista-ChartMPL-legend_visible-1_01_00.png

凡例を隠します.

>>> chart.legend_visible = False
>>> chart.show()
../../../../_images/pyvista-ChartMPL-legend_visible-1_02_00.png