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

Plot_var - Scaling #253

Open
dzrobert opened this issue Aug 1, 2019 · 7 comments
Open

Plot_var - Scaling #253

dzrobert opened this issue Aug 1, 2019 · 7 comments

Comments

@dzrobert
Copy link

dzrobert commented Aug 1, 2019

The old plot var allowed the user to define the limits on the plot. Is there any way to do that anymore?

@hdugan
Copy link
Collaborator

hdugan commented Aug 1, 2019

Dale, to clarify, it looks like the old function had ability to set the x-axis dates, but not the y. Is that functionality you're looking for?

To the larger audience, right now the function is set up so you can use ggsave right in function. However, I think I could make the plotting function more versatile (like setting axes for instance, basically adding more ggplot functionality) if I remove the save function. Instead, the plotting function (plot_var) would produce a plot on-screen, and then you could save it.

Current Code:

plot_var(..., fig_path = 'savethis.png', height = 6, width = 6, units ='in')

New Code layout:

p1 = plot_var(...)
ggsave(p1, 'savethis.png', height = 6, width = 6, units ='in')

@jordansread
Copy link
Member

I like the pattern where if filepath is NULL, the function returns the plot object (p1 here), vs if it is a filepath, that is used to save the plot.

@hdugan
Copy link
Collaborator

hdugan commented Aug 1, 2019

okie doke. can keep it that way

@jordansread
Copy link
Member

does the current code do that? return something different depending on the fig_path variable?

@dzrobert
Copy link
Author

dzrobert commented Aug 1, 2019

I was referring to the scale used in the plots. Like TP going from 0 to 300 or 0 to 1000, Having the code pick the scale is nice, but often there is one very high point that results in one very small red spot and everything else white.

@hdugan
Copy link
Collaborator

hdugan commented Aug 2, 2019

Dale, ok, so with the z-variable. Got it. Will try and implement that. You could create a custom palette, where it emphasizes the lower values, but I understand that might be time consuming.

Jordan, the fig_path variable works the way it always did. I was just thinking the saving feature could be separate from the function, as ggplot makes that very easy. But I'll keep it as is.

@jordansread
Copy link
Member

ok, good to know. I've been behind on poking around on this branch. Will try to soon.

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

3 participants