Hey guys, I want to show stores sales difference on Plotly mapbox. I am normally using one variable and it is fine but when I try to show negative and positive numbers as different variables I could not manage to visualise. In my data some stores are earning good money some are losing and show up as a negative number. I want to display where revenue is negative (different color but same size as positive sales)
The code I am using;
import plotly
import plotly.plotly as py
from plotly.graph_objs import *mapbox_access_token = âmapbox tokenâ
data = Data([
Scattermapbox(
lat=part1_loc[âLatitudeâ],
lon=part1_loc[âLongitudeâ],
text = part1_loc[âdiff2018â],
mode=âmarkersâ,
marker=Marker(
showscale=True,
cmax=39000,
cmin=-27000,
size= part1_loc[âdiff2018â]/300,
color =part1_loc[âdiff2018â],
#color =ârgb(255, 0, 0)â,
colorscale= âPortlandâ,
opacity=0.6,
symbol = âcircleâ,), )
])
layout = Layout(
autosize=True,
hovermode=âclosestâ,
width=1450,
margin=go.Margin(
l=10,
r=100,
b=10,
t=10
),
height=650,
mapbox=dict(
accesstoken=mapbox_access_token,
bearing=0,#
center=dict(
lat=-37,
lon=175
),
pitch=0,
zoom=8.9,
style=âlightâ,),
)
fig = dict(data=data, layout=layout)
py.iplot(fig, filename=âKiwiInstant_sales_retailer_kiwi_instantâ)
Also I saw two variables Plotly on internet that here Shows you can put two different variables but I do not know how I can describe as a negative and positive numbers in one data.
Thank you in advance