Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use plot recipes (from RecipesBase) #17

Open
mforets opened this issue Jun 13, 2021 · 3 comments
Open

Use plot recipes (from RecipesBase) #17

mforets opened this issue Jun 13, 2021 · 3 comments

Comments

@mforets
Copy link
Contributor

mforets commented Jun 13, 2021

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.

@mforets
Copy link
Contributor Author

mforets commented Jun 24, 2021

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)

@mforets
Copy link
Contributor Author

mforets commented Jul 18, 2021

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.

@AnderGray
Copy link
Owner

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants