hi @adamschroeder, very glad to have your reply.
This is how the graph looks like in the HTML file, everything works fine, all functions run normally. In the mini pic you can see that all graphs and the colorbar remain clear after zooming it in。
This is what the svg file looks like. (I can’t upload svg file so I make a jpeg screenshot of SVG here and use a zooming-in mini pic to illustrate the problem) In the mini pic, you can see that the colorbar remains clear, but the map becomes unclear, showing that “fig.write_image” command does not give the right svg file:
The png file looks just the same as the other format so I didn’t put it here due to the 5 limitation of media posting of new users. In the mini pic you can see that the colorbar and the map graph all become unclear, which is expected when zooming in a png bitmap:
This is the command to make map graph:
# drawing map box, background-color: inner distance
fig = px.choropleth_mapbox(credit_rank,geojson = Sichuan,
locations='adcode',featureidkey='adcode',
color='inner_distance',
color_continuous_scale="Reds",
#range_color=(0, 1),
mapbox_style="white-bg",
center={'lon':102.06,'lat':30.65},
zoom=5,
opacity=1,
labels={'value':'inner_distance'},
hover_name = credit_rank.index
)
# formating layout
fig.update_layout(margin={"r":0,"t":0,"l":0,"b":0},height=600,width=700)
fig.write_image("fig.svg")
here is the info of packages and Python:
plotly: 5.9.0
kaleido: 0.2.1
python: 3.11.4
thanks a lot, best wishes to you and your team.