I’m a new user of plotly. My plot’s x-axis (label/tick) values do not match the data specified for the x axis.
import pandas as pd
import oracledb as odb
import plotly.express as px
connection = odb.connect(...)
try:
df = pd.read_sql_query("select SOMEATTR, OTHERATTR, SOMETYPE from SOMETABLE where ...", con=connection)
except odb.DatabaseError as dberror:
print(dberror)
fig = px.bar(df, x="SOMEATTR", y="OTHERATTR", color="SOMETYPE", orientation='h')
fig.update_xaxes(rangemode="normal")
fig.write_html('first_figure.html', auto_open=True)
SOMEATTR values range from 0 to 7.2808 in my example. The plot shows a label of 900 near the end of the bar chart. I would expect axis labels/ticks ranging from 0 to 7 or 8, not 0-900.
Can someone help?