Using custom colorscale with subplots


I wish to use a custom colorscale with several scatter plots displayed as subplots.

Each subplots has about 24 dots, and each dot has a unique value associated with it that I wish to express using color.
Despite those values being unique, they all fall in the same range between about 0 to 50, i.e they’d all fit on the same scale.

The coloring works fine, but the problem is that each plot gets its own color scalebar which are then displayed on top of each other next to the subplot which makes it chaotic and unreadable.

Could you suggest a way of how I could make this work?

Correct. Plotly colorbars are per-trace attributes and by default each trace with a colorscale gets a colorbar.

To remove a trace’s colorbar use the showscale attribute.

in your case, you could remove all but the first trace’s colorbar and make that colorbar span [0, 50] using cmin and cmax.

Hi !
I am doing scatter plot subplots in one plot. The colors of my points correspond to a quantitative variable. Is there a way to set a unique colorscale for the different subplots ?

Not at the moment unfortunately, you’ll have to copy the colorscale information to all traces.

Is there a way to set a common colorscale for each of the traces? My subplots are getting different scales due to different min and max values ;/
I want to obtain the same colours for all the subplots just basing the bar colours on their values.