Please see attached picture and the example below.
Not sure if this is a bug or Iām doing it wrong? If opacity is commented out, everything works as expected.
>> plotly.__version__
'5.6.0'
Minimal working example:
import pandas as pd
import plotly.graph_objects as go
from plotly.subplots import make_subplots
z_data = pd.read_csv(
"https://raw.githubusercontent.com/plotly/datasets/master/api_docs/mt_bruno_elevation.csv"
)
fig = make_subplots(
rows=1,
cols=2,
specs=[[{"is_3d": True}, {"is_3d": True}]],
)
fig.add_trace(go.Surface(z=z_data.values))
fig.add_trace(
go.Scatter3d(
x=(1, 1),
y=(1, 1),
z=(1, 1),
opacity=0.75, # comment out and problem solved
)
)
fig.add_trace(go.Surface(z=z_data.values), 1, 2)
camera = dict(
eye=dict(x=-1.75, y=1.75, z=0.5),
)
fig.update_layout(
scene2_camera=camera,
)
# fig.show() # works with/without opacity
fig.write_image("test.png")
Best regards
Florian