I generate a new figure for my plots depending on a radio button selection. One of the options shows a discretely colored plot that I set in the figure with color_discrete_map={βYesβ: β#EFF814β, βNoβ: β#13078Aβ}.
When I switch to one of my continuous colored map options (e.g. color_continuous_scale=βHot_Rβ) and then back to my discrete map selection, the coloring is showing the gradient from the previous plot.
This only happens in the case where the map is only plotting 1 discrete value, so all βYesβ or all "No. If both βYesβ and βNoβ values are present in one of the maps then the coloring gets set correctly. When you download the graph it actually downloads with the legend colored correctly, it just isnβt displaying it right in the browser.
The figures are generated by different functions. I have tried setting fig to None before generating. I donβt know if there is some better way to βclearβ the figure first or specify the discrete coloring if thereβs only 1 value showing. It works fine if I have not yet plotted a continuous scale plot.
Any help would be much appreciated!