Hi, I want to set the scale of y axis uneven, which means the different value intervals for the same plotting intervals. See the picture below as an example.
Hi @HaoXu
you mean changing the tickvalues?
import plotly.graph_objects as go
# trace
trace = go.Scatter(
x=[10, 20, 30, 40],
y=[10, 20, 30, 40],
mode='markers+lines'
)
# base figure
fig=go.Figure(data=trace)
# update yaxis
fig.update_yaxes(
tickvals=[10, 20, 30, 40],
ticktext=[100, 2000, 30000, 400000]
)
# update height and width for clarity
fig.update_layout({'width': 400, 'height': 400})
fig.show()
Result:
Hi, thanks for your replying. But I dont think this is what I want. Actually, I need to plot two variables by barplot at each of the positive and negative y axis. But the range of the values of these two variables is quite different, such as the positive one is from 0 to 20, but the negative one is from 0 to -3000. So, if the equidistant y axes are used, then the postive one will not be shown clearly. So I want to set the y axes inequidistant. For example, at the postive y axis, one pixel means 1 value, but at the negative side, one pixel 10 value.
Hi,
if the built in logarithmic axis type does not help in this case, I guess you will have to transform your data in an appropiate way before plotting.
Yeah, thatβs also a way. I have done like that.