I am using R version of plotly. Here is what I want:
x = 1:100
y = 1:100
plot_ly(x, y)
I want the graph only show where x>20 and x<40, ignoring the other part. How to do this ?
Setting the Range of Axes Manually The visible x and y axis range can be configured manually by setting the range axis property to a list of two values, the lower and upper boundary. Here's an example of manually specifying the x and y axis range for a faceted scatter plot created with Plotly Express.
If I understand you right you want to limit the range of the y-axis itself. You can pass a dict in the keyword argument yaxis . It could be something like go. Layout(yaxis=dict(range=[0, 10])) I hope this helps you.
You can rotate the plot by setting x=-x , and/or y=-y .
Tickangle=90 means that the labels will be rotated by 90° clockwise. If you use the negative sign, you rotate the labels by 90° anti-clockwise, so just the other direction.
Set the layout
of xaxis
.
y = 1:100
plot_ly(x=~x, y=~y) %>%
layout(
xaxis = list(
range=c(20,40)
)
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With