使用破折号保留绘图图形的比例

问题描述 投票:0回答:1

我想知道如何使用破折号保留绘图图形布局。 这是没有破折号的样子:

这就是使用 Dash 时的样子:

我使用 Dash 是因为我想让端口号保持一致(例如 8050)。

这是我的代码:

# Show plot
# fig.show()

# Port number for the web server
port_number = 8050

# Initialize a Dash app
app = dash.Dash(__name__)

# Defining the layout
app.layout = html.Div([
    dcc.Graph(figure=fig)
])

# Run the app on the specified port
app.run_server(port=port_number)
python plotly-dash
1个回答
0
投票

您是否尝试过更改图形对象的视口大小?

dcc.Graph(figure = fig, style = {'width' : '90vh', 'height' : '90vh'})

图表现在似乎将占据浏览器页面的 90%。

参考:如何更改 Dash Graph 的大小?

© www.soinside.com 2019 - 2024. All rights reserved.