ProbabilityBoundsAnalysis.jl
ProbabilityBoundsAnalysis.jl copied to clipboard
Use plot recipes (from RecipesBase)
Loading Plots (the library) and this package conflict because of the definitions around here. It may be possible to change the dependency to RecipesBase
(instead of PyPlots) and adds plot recipes, which dispatch on the new types defined in the package.
The main PyPlot - specific option used seems to be the step function, may be generalized with sth like
pyplot()
j = (0:(s.n-1))/s.n;
Plots.plot([s.u[:];s.u[s.n];s.d[s.n]], [j;1;1], linetype=:steppre)
i = (1:(s.n))/s.n;
Plots.plot!([s.u[1];s.d[1];s.d[:]], [0;0;i], linetype=:steppost)
An easy alternative (if you are not interested in supporting other plotting backends in this package) might be to add PyPlot as an optional dependency through Requires.jl, and rename the plotting functions to avoid the name clash with someone using Plots.jl
, eg. plot_pbox
and plot_cdf
. For reference with this approach, see this package.
Thanks for this suggestion. I've added a branch using this as a quick fix.
PyPlot and PyCall are no longer in the dependencies.
Also started migrating over to Plots.jl, but having some problems when specifying pyplot as the backend...