I’m trying to produce a scatter plot where only text is shown instead of ‘marker+text’: this is a map of maximum 2m temperature. I need to color as well the text in the same way it is done to the markers, according to the variable that I’m plotting (in this case temperature). Something similar to this:
Somehow passing an array of values as color property to
textfont is not supported as in the
marker property: you need to pass an array of colors already mapped onto the colorscale… So I went ahead and made my own list of colors (as RGBA strings) by mapping the colorscale to the max/min of the values. Then I used this list of colors in the
textfont.color property of
go.Scattermapbox as indicated here Text and Annotations | Python | Plotly.
However I discovered that this only works when using
go.Scattermapbox only accepts a single color for the text.
Why is that? Is there any workaround?