JuliaDynamics / TransitionsInTimeseries.jl

Transition Indicators / Early Warning Signals / Regime Shifts / Change Point Detection
MIT License
18 stars 5 forks source link

Convenience functions for plotting #63

Closed JanJereczek closed 7 months ago

JanJereczek commented 8 months ago

Is your feature request related to a problem? Please describe. Plotting of the results is generic. Therefore providing a convenience function for it would cut down the amount of code needed.

Describe the solution you'd like Rely on CairoMakie and allow something like:

plot(results, signif)
Datseris commented 8 months ago

I added a first draft of these functions here:

https://github.com/JuliaDynamics/TransitionsInTimeseries.jl/blob/main/ext/TITVisualizations.jl

a new PR needs to document them and add them in the examples in the docs.

JanJereczek commented 7 months ago

Thanks for starting this, George! I would mainly suggest one modification. I think we should have a plot with n+1 rows and 1 column, with n the number of indicators. In the first row, we plot the input timeseries and optionally some surrogates in a lighter shading. For the i+1-th row, we plot the timeseries of the i-th indicator and its change metric.

I think this fits better than what we have so far (plotting all indicators on one axis), since they can have very different orders of magnitude, which is very inconvenient for visualisation.

If you agree, I am happy to make this change in the code and make a PR soon :)

Datseris commented 7 months ago

What about the change metrics? where do you plot those? Or do you suggest that we plot directly the change metrics?

JanJereczek commented 7 months ago

Since each indicator has a subplot assigned to it, it is easy to add an axis to each of them to visualise the change metric associated with the indicator. Something like:

indic_ax = Axis(fig[i, 1], yaxisposition = :left)
chng_ax = Axis(fig[i, 1], yaxisposition = :right)
Datseris commented 7 months ago

So you mean to plot the indicator timeseries and the change metric timeseries in the same panel? Yes, we can do that.