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

Customizing plots #22

Open
samarth8392 opened this issue Feb 26, 2021 · 2 comments
Open

Customizing plots #22

samarth8392 opened this issue Feb 26, 2021 · 2 comments
Labels

Comments

@samarth8392
Copy link

I am wondering is there a way to customize the plot_Runs?
I have 15 populations and total 115 individuals and it is pretty hard to visualize output. Also, can we change the ggplot theme to a more basic theme without the gray background?

Thanks.

@bunop
Copy link
Contributor

bunop commented Feb 26, 2021

Dear @samarth8392 ,

Thank you for your interest in detectRUNS. Unfortunately, at the moment, there's no such type of customization of plot_Runs function and, before to implement it, we need to think about how to change this in order to be used by everyone and not only in your particoular case.

Regarding your problem: if you have a lot of data to display you should consider to filter out the calculated runs dataframe before calculating graphs in order to focus only on a subset of individuals or populations per graph. For the ggplot theme change, a solution could be to start from our implementation of plot_Runs and write a new custom function in order to change graph according your needs. For example, to remove the gray background, you could apply the theme_bw() immediately after the graph initialization:

    p <- ggplot2::ggplot(teilsatz)
    p <- p + theme_bw()    # This will apply a white background
    p <- p + ggplot2::geom_segment(data=teilsatz,aes(x = from, y = id, xend = to,
                                                     yend = id,colour=as.factor(group)),alpha=alfa, size=grosse)

Maybe the background only is not enough and you need also to remove grids, take a look at this guide in order to remove elements from ggplot2.

If you have suggestions (or if you can provide examples) on how to display many data on the same graph, let us know

@bunop bunop added the question label Feb 26, 2021
@samarth8392
Copy link
Author

Hi Paolo,
Thank you for your immediate response. I am going through my output data frame to create the most interesting subset for better visualization, as opposed to just displaying everything.
I also appreciate your feedback about rewriting the code as a custom function and changing the themes there. After I posted the question yesterday, I thought that too, but after reading your response, this is now exactly what I am going to do.
Thank you for you help, and I will ask for more help in case I run into more trouble.
Thanks,
Samarth

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

No branches or pull requests

2 participants