Using the documentation of plotly.Surface
and this answer I have the following code:
import pandas as pd
from dash import Dash, html, dcc
import plotly.graph_objects as go
app = Dash(__name__)
z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/api_docs/mt_bruno_elevation.csv')
fig = go.Figure(data=[go.Surface(z=z_data.values, colorscale='Greens')])
fig.update_traces(showscale=False)
fig.update_xaxes(domain=(0, 1))
fig.update_yaxes(domain=(0, 1))
app.layout = html.Div(children=[
dcc.Graph(
id='green',
figure=fig,
style={'width': '100vh', 'height': '100vh'}
)
])
if __name__ == '__main__':
app.run_server(debug=True)
The goal is to stretch the figure along the horizontal axis / across the whole window. However, this doesn't happen because the output looks as follows:
How do I make sure the image fills the whole page along the x-axis?