I am making several scatter plots. Some of the scatter plots display data from 0-12, some go from 0-15 etc. The legend will show 0-max for each graph, but it makes them hard to compare, as 12 on one is the max and it is only about 80% of max on the other (so one will show blue, the other green) I want to set it to where the same color is shown for the same number each time, ie blue is always the max I pass in.
def makeplot(ptitle,data,htmlname,variable,outpath,lim=0):
fig = px.scatter(data, x = 'var1', y='var2', color = variable, color_continous_scale=['red','orange',yellow',green','blue'], title=ptitle)
@Jacob - To set each value (0 to red, 12 to green, etc.), you can set the number of entries you are providing to the
color_continous_scaleas below. But do be careful to ensure that the number of entries are less than or equal to the number of colors. Also, as you are providing a discrete set of colors to the scatter plot, assuming that the values of var1 and var2 will be within this set.