Hey!
I have a plotly figure which I can confirm is correct using fig.show() in my code. When I log the figure using
wandb.log({“figure_name”: fig}, the data is wrong. If I upload the figure as an image by exporting the plotly figure first to an image and use wandb.Image(), you can clearly see the difference side by side:
the one on the left is the logged image(correct data displayed), the one on the right is the logged interactive plotly plot (wrong data displayed).
Why is that? I already tried calling wandb.Plotly(fig) for logging, this did not made a difference.
For reference, this is how the plotly figure is created:
traces.append(go.Scatter(x=pred['PREDICTION_DATE'].tolist() + pred['PREDICTION_DATE'].tolist()[::-1],
y=pred['85th Quantile'].tolist() + pred['50th Quantile'].tolist()[
::-1], fill='toself',
fillcolor='rgba' + str(matplotlib.colors.to_rgba(light_color, 0.3)),
line=dict(color='rgba(255,255,255,0)'),
name=f'Uncertainty (Material {material_id})', showlegend=False, hoverinfo='skip',
line_shape='spline'))
# Forecasted fill level
traces.append(go.Scatter(x=pred['PREDICTION_DATE'], y=pred['50th Quantile'], mode="lines+markers",
name=f'Material {material_id} Forecast',
line=dict(color=main_color),
# hovertemplate=f"Material Type: {material_id}<br>Date: %{{x|%Y-%m-%d}}<br>Fill Level: %{{y:.2f}}%<br>Uncertainty: %{{customdata:.2f}}%",
# customdata=pred['85th Quantile'], showlegend=False,
line_shape='spline'))
# Actual fill levels
traces.append(
go.Scatter(x=label['PREDICTION_DATE'], y=label['LABEL'], mode="markers",
name=f'Actual Levels (Material {material_id})',
marker=dict(color=main_color, symbol='star', size=10,
line=dict(width=1, color='DarkSlateGrey')),
# hovertemplate=f"Material Type: {material_id}<br>Date: %{{x|%Y-%m-%d %H:%M:%S}}<br>Slider Level: %{{y:.2f}}%",
showlegend=False))
fig = go.Figure(traces)
If I did not mess up somehow, this seems like a very dangerous bug, since you would not expect any changes to the underlying data when logging.
Any help is much appreciated.