相关疑难解决方法(0)

Plotly:如何在构面网格中旋转 y 轴标题?

在此输入图像描述

您好,您看到的问题是标题在右侧挤在一起,有什么办法可以旋转它吗?多谢。

fig = px.box(df, 'deposit_amt', color = 'class', facet_row= 'Age_Group')
Run Code Online (Sandbox Code Playgroud)

python visualization plotly

3
推荐指数
1
解决办法
3905
查看次数

你能改变情节中的子情节标题位置吗?

当将 subplot_title 添加到我的子图中时,我的标题与我的轴重叠。我可以像 matplotlib 那样改变子图标题的位置吗ax.set_title('title', y=1.5)

这是我的情节,你可以看到舞蹈能力重叠: 在此输入图像描述

到目前为止,这是我的代码:

from plotly.subplots import make_subplots
categories = ['key', 'acousticness', 'danceability', 'energy',  'loudness',
         'speechiness', 'tempo','key']

fig = make_subplots(rows=1, cols=2, specs=[[{"type":"polar"}, {"type":"polar"}]],
                    subplot_titles=('Clustering Into 8 Playlists', 'Clustering Into 11 Playlists'))

fig.add_trace(go.Scatterpolar(
          r=x,
          theta=categories,
          fill='toself',
          name='Cluster 1',
           visible='legendonly'
    ), row=1, col=1)

fig.add_trace(go.Scatterpolar(
          r=y,
          theta=categories,
          fill='toself',
          name='Cluster 2',
           visible='legendonly'
    ), row=1, col=2)

fig.update_layout(height=600, width=1400, title_text='Radar Plot of All Clusters (Fig.4)')
fig.show()
Run Code Online (Sandbox Code Playgroud)

python subplot plotly

2
推荐指数
1
解决办法
3636
查看次数

标签 统计

plotly ×2

python ×2

subplot ×1

visualization ×1