2017-08-09 13 views
1

私はプロットしたテーブルを持っています。フォントを 'Gill Sans'に変更したいのですが。Plotly Python - テーブルのフォントを変更

変更に問題があります。これは可能ですか?

これは私のコードです:

groupA = new_df.groupby('Call').agg({'TotalGrantValue':sum, 'FirstReceivedDate':'count'}).rename(columns={'FirstReceivedDate':'Count'}) 
groupA['TotalGrantValue'] = groupA['TotalGrantValue'].map('{:,.2f}'.format) 

colorscale = [[0, '#7f7f7f'],[.5, '#F1EDED'],[1, '#ffffff']] 

table = ff.create_table(groupA, index=True,colorscale=colorscale, height_constant=14, index_title='Date') 
table.layout.width = 700 
for i in range(len(table.layout.annotations)): 
    table.layout.annotations[i].font.size = 10 
plotly.offline.iplot(table, config={"displayModeBar": False}, show_link=False, filename='index_table_pd') 

答えて

1

あなたはhttps://plot.ly/python/axes/に述べたように、レイアウトパラメータを定義する必要があります。

同じページから、あなたを助ける必要があるのコード例があります:

layout = go.Layout(
    xaxis=dict(
     title='AXIS TITLE', 
     titlefont=dict(
      family='Arial, sans-serif', 
      size=18, 
      color='lightgrey' 
     ), 
     showticklabels=True, 
     tickangle=45, 
     tickfont=dict(
      family='Old Standard TT, serif', 
      size=14, 
      color='black' 
     ), 
     exponentformat='e', 
     showexponent='All' 
    ), 
    yaxis=dict(
     title='AXIS TITLE', 
     titlefont=dict(
      family='Arial, sans-serif', 
      size=18, 
      color='lightgrey' 
     ), 
     showticklabels=True, 
     tickangle=45, 
     tickfont=dict(
      family='Old Standard TT, serif', 
      size=14, 
      color='black' 
     ), 
     exponentformat='e', 
     showexponent='All' 
    ) 
) 
fig = go.Figure(data=data, layout=layout) 
py.iplot(fig, filename='axes-labels') 
+0

あなたFedRoをありがとう、私は今それをチェックアウトします:) – ScoutEU

+0

あなたは歓迎されている:) – FedRo

関連する問題