I have this code. I’m trying to create a map with the plotly_express markers showing a certain text (from the type column, which is included) right on top of the markers, hence the text = ‘Type’ and textposition = ‘top center’. (See code below.) But when I run the code, the text only appears when I hover, which is the opposite of what I’m looking for. How to fix this issue? To be clear, I specifically want to use px.scatter_mapbox(), not go.scattermapbox() as that’s too complicated for me.
I built a self-contained example (below) from your code, and it seems to work - ‘type’ is always shown, and other things appear on hover. Is that what you’re aiming for?
(Your color coding makes the text difficult to see maybe?)
Sorry, I don’t see the type above the marker. This is what I see when I run your code. The names of the cities on each marker appear, but I’m not sure if that’s because they’re already on the map. What I’m trying to do is get the type column to appear on top of the map permanently without needing to hover.
I want the text from the Type column to show up as soon as the map loads, rather than only appearing on hover. I’ve already included the text argument to pull in the Type values, and I set the textposition to 'top center', but it still only shows the text when I hover over the markers. I need to stick with px.scatter_mapbox() because I find it easier to use than go.scattermapbox().