I’ve been attempting to duplicate a plot and there have some strange surprises that have appeared.
When I create the first plot, everything works fine, but when I go to export it by preparing a separate plot (I grab the data from the first plot and deep cloning it to avoid any references to the original data, I then make visual changes to the plot - background color, line width, etc.) a few things happen:
- The background color changes (sometimes, I haven’t been able to pinpoint why it happens or where)
- If the duplicate plot does modify the way I want, then when I zoom into the plot it reverts to the original setting
- Both plots are changed (to the settings defined for the second plot)
I have considered using the HTML cloneNode method to create a copy of the HTML itself, however, this isn’t an ideal solution because it would lose a lot of the JavaScript listeners Plotly has connected to the Plotly.js generated plots.
As plotly users, have you encountered this problem before? If so, how did you resolve it?