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

Refactoring plotting #77

Open
alexpghayes opened this issue Feb 22, 2022 · 1 comment
Open

Refactoring plotting #77

alexpghayes opened this issue Feb 22, 2022 · 1 comment

Comments

@alexpghayes
Copy link
Owner

Where I'm at so far:

  • I think having plot_pdf() and plot_cdf() are valuable even if there is some code repetition because the names are the most clear, and beginners in my experience have struggled with function arguments (i.e. type = "cdf" vs type = "pdf"), and we can take away that potential snag via specialized functions names at little additional maintenance cost.

  • I don't think that having two distinct plotting systems is beginning friendly. I think it is important that there is one canonical way to do things in this package. I'm actually increasingly convinced aliasing plot() and autoplot() is going to cause beginner confusion.

  • I don't particularly mind a ggplot2 hard dependency.

@zeileis
Copy link
Collaborator

zeileis commented Feb 22, 2022

  • If you want to have separate plot_pdf() and plot_cdf() functions, I would implement these as simple convenience interfaces to the more flexible underlying plot() function. Essentially plot_pdf <- function(x, ...) plot(x, what = "pdf", ..) or something like that. This keeps the code DRY and facilitates maintenance while still providing shortcuts for beginners.
  • Many teachers will not have covered ggplot2 when using this package for basic probability theory - and conversely many teachers will not go into base graphics but only cover ggplot2. So I would be inclusive to all of these and provide infrastructure for both plotting paradigms. This necessitates some explanation for beginners but I think that even most of them are quickly aware of that both systems exist and work rather differently.
  • I'm not particularly worried about a ggplot2 dependency. I just think that so far it can be avoided relatively easily without disadvantages for those who want to use it. The benefit would be a leaner list of inherited dependencies for for future reverse dependencies that are likely to use mostly the distributional functionality and not necessarily the visualization infrastructure.

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