We are trying to figure out how to have unabbreviated tick marker on our plot. currently the plot shows 3.5M but we would like it to show 350000.
current code:
import dash
import dash_bootstrap_components as dbc
fig = dict({
“data”: [{“type”: “bar”,
“x”: [100000, 2222222, 333333],
“y”: [111122, 3344445, 2987523]}],
“layout”: {“title”: {“text”: “A Figure Specified By Python Dictionary”}}
})
To display the figure defined by this dict, use the low-level plotly.io.show function
import plotly.io as pio
pio.show(fig)
Thanks
Hi @desertwrangler ,
You can set tickmode
as array
for both yaxis
and xaxis
.
You also need to set tickvals
and ticktext
.
import dash
import dash_bootstrap_components as dbc
fig = dict({
"data": [{"type": "bar",
"x": [100000, 2222222, 333333],
"y": [111122, 3344445, 2987523]}],
"layout": {
"title": {"text": "A Figure Specified By Python Dictionary"},
# Add xaxis tick mode as array
"xaxis": dict(tickmode = 'array',
tickvals =[100000, 2222222, 333333],
ticktext = ['100000', '2222222', '333333']),
# Add yaxis tick mode as array
"yaxis": dict(tickmode = 'array',
tickvals =list(range(0,3_600_000,500_000)),
ticktext = [str(val) for val in range(0,3_600_000,500_000)])
}
})
#To display the figure defined by this dict, use the low-level plotly.io.show function
import plotly.io as pio
pio.show(fig)