Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Hvplot 默认图例的位置在图的右侧。 如何更改此默认图例位置?
import numpy as np import pandas as pd import hvplot import hvplot.pandas import holoviews as hv data = np.random.normal(size=[50, 2]) df = pd.DataFrame(data, columns=['a', 'b']) df.hvplot.line()
您可以通过将.opts(legend_position='top_left')添加到代码中来将图例位置更改为左上角。
df.hvplot.line().opts(legend_position='top_left')
如果您想将图例放置在情节中,可以从以下选项中进行选择:
['top_right', 'top_left', 'bottom_left', 'bottom_right']
如果要将图例放在情节之外,可以从以下选项中进行选择:
['右','左','上','下']