我正在使用plotly生成交互式图。就我而言,我将有一张桌子和一张图。 https://docs.oracle.com/javaee/7/api/javax/persistence/SecondaryTable.html
import matplotlib
matplotlib.use('Agg')
import plotly.offline as offline
from plotly import tools
import plotly.graph_objs as go
trace1=go.Scatter(x=[1, 2, 3], y=[1, 3, 5], name='abc', mode = 'lines+markers', xaxis='x1', yaxis='y1', showlegend=True)
trace2=go.Scatter(x=[1, 2, 3], y=[1, 2, 3], name='cba', mode = 'lines+markers', xaxis='x1', yaxis='y1', showlegend=True)
trace3=go.Table(
domain=dict(x=[0, 1], y=[0, 0.5]),
header=dict(values=['', 'fields1', 'fields2', 'fields3']),
cells=dict(values=[[['row1'], ['row2'], ['row3']], [['11'], ['12'], ['13']], [['21'], ['22'], ['23']], [['31'], ['32'], ['33']]], font = dict(color = '#506784', size = 11))
)
axis=dict(
showline=True,
zeroline=False,
showgrid=True,
mirror=True,
ticklen=4,
gridcolor='#ffffff',
tickfont=dict(size=10)
)
param1 = dict(
xaxis1=dict(axis, **dict(domain=[0, 1], anchor='y1', showticklabels=False)),
yaxis1=dict(axis, **dict(domain=[0.55, 1], anchor='x1', tickprefix='$', hoverformat='.2f')),
)
layout1 = dict(
title='Bitcoin mining stats for 180 days',
margin = dict(t=100),
showlegend=False,
plot_bgcolor='rgba(228, 222, 249, 0.65)'
)
layout1.update(param1)
fig1=dict(data=[trace1, trace2, trace3], layout=layout1)
offline.plot(fig1, auto_open=False, output_type='file', filename='abc.html')
如何删除表格下方的空间?粪便的大小可以根据元素的实际大小自动更改吗?
答案 0 :(得分:1)
查看您的val i = new ImportTest()
参数,尤其是在设置yaxis的位置:
domain
和
domain=dict(x=[0, 1], y=[0, 0.5]),
通过代码,您说表格将在y轴上绘制0%到50%之间。和图形-55%至100%之间。但看!您的表格太小,无法填补该空白(50%)。
所以您必须选择解决问题的方法:
代码:
yaxis1=dict(axis, **dict(domain=[0.55, 1],