I am using Plots.plot along with PlotlyJS to display a time-series in the VSCode editor as follows:
using Plots
using PlotlyJS
...
plotlyjs()
plot = Plots.plot(dates, y)
display(plot)
So while the plot is "interactive" the dates do not adapt dynamically to the selected region. Here is a quick video of the issue I'm facing. Ideally I want the dates to display in a nice way every time I am zooming in (or out), and not just being fixed once at initial creation.
How can this be achieved?
Your problem is close to Github issue 1382. The issue was that Plots calculates the ticks before sending it to the backend via plotlyjs(), so the ticks end up "frozen" even if the backend is normally adaptive. They implemented an argument ticks = :native (issue 1395) to fix this, but be aware that it doesn't work well with some arguments, which is why it's not the default (issue 1425, issue 3263).
An example of its usage from issue 1395:
using Plots; plotly()
plot(rand(10), ticks = :native)
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