import plotly.figure_factory as pff
import os
def make_images(arglist):
df, endpts, map, type, scale = arglist
datelist = df.index.tolist()
for ddate in datelist:
dlist = ddate.split('/')
datenow = '20' + dlist[2] + dlist[0].rjust(2, '0') + dlist[1].rjust(2, '0')
datenowslash = '20' + dlist[2] + '/' + dlist[0].rjust(2, '0') + '/' + dlist[1].rjust(2, '0')
fig = pff.create_choropleth(
fips=df.columns.tolist(),
values=df.loc[ddate],
scope=[map],
county_outline={'color': 'rgb(0,0,0)', 'width': 0.5},
binning_endpoints=endpts,
)
fig.update_layout(
autosize=False,
width=2000,
height=1066,
showlegend=False,
title={
'text': '<b>stuff goes here</b>',
'y': 0.2,
'x': 0.1,
'xanchor': 'left',
'yanchor': 'middle'},
)
imgpath = os.path.join(type.replace(' ', '_'), 'frame-' + datenow + '.png')
fig.write_image(imgpath, scale=1.0)
df has one column for each county, and one line for each date. I cycle through lines and make one image (map) per date.
It seems to use a continuous color scheme, and it looks quite similar to Viridis. How can I change that? I want to use Inferno instead. I spent a lot of time digging through the documentation, to no avail. Thanks!