import plotly.express as px
fig = px.scatter(df, x='Temperature, y='energy', color="state", facet_col_wrap=1,
facet_col="state", trendline="lowess",trendline_color_override="black")
I have a dataframe of a country and df contains groups which are states of this country. I want to plot the correlation between temperature (x-axis) and energy consumption (y-axis) in each state, and I want to draw a regression line for each state scatter plot. The problem is that I could not change the range of y-axis for each plot and I have some states in which their consumption are very low compared to other states. PX now selected the maximum consumption value over all states and set this value to y-axis for all states. So, I ended up with this plot:
Any help, highly appreciated!