adjusting color and alpha in plot.mtpc

21 views
Skip to first unread message

maria

unread,
Nov 3, 2020, 2:35:24 AM11/3/20
to brainGraph-help
Hi Chris, 

I‘m doing some fine tuning for final plots generated from your braingraph package for a publication. The editorial office asked me to reproduce the mtpc plots in a colorblind friendly way. 

Is there a way to adjust the colors? The usual ggplot scale_color commands don´t seem to work. Also is there a way to adjust the alpha and size of the null stat points? 

Thank you!

Maria

Chris Watson

unread,
Nov 3, 2020, 9:53:46 AM11/3/20
to brainGr...@googlegroups.com
Unfortunately the only easy way is for you to edit "plot.mtpc" for your purpose. I should probably make a global option to allow for this kind of thing but I don't know when I'll be able to get around to it.

To edit it you would have to either clone the GitHub repository, edit "mtpc.R", and source that file; or run "plot.mtpc <- edit(brainGraph:::plot.mtpc)" and edit from within the R console.

* For the observed data: in the code you will see that the color "red4" is used several times, so you can find & replace for that string. You can also see where "alpha" is used (variously set to 0.3 or 0.4).
* For the null points: you can change "darkgreen" to whatever you want. To change the size you will have to add a "size=X" to the function call and replace "X" with the number you want. Set it to something smaller than 1 to make the points smaller. This line of code occurs where it says "if (isTRUE(show.null))"

These are all in the "plot_single" local function (local to "plot.mtpc") if you have ggplot2 installed.

Please let me know if you run into any issues.
Chris

--
You received this message because you are subscribed to the Google Groups "brainGraph-help" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brainGraph-he...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brainGraph-help/04bef68a-f028-40d1-8a68-383be2b73393n%40googlegroups.com.

Maria Feldmann

unread,
Nov 6, 2020, 5:24:45 AM11/6/20
to brainGr...@googlegroups.com

Works perfectly, thank you so much!

--
You received this message because you are subscribed to a topic in the Google Groups "brainGraph-help" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/brainGraph-help/cu0WVBXK8Bk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to brainGraph-he...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brainGraph-help/CAHVz74hfAiBiYA2Y5DHgeMdnWof8a-qxCVO15%3D5n0Qx-_EuHrg%40mail.gmail.com.

Reply all
Reply to author
Forward
0 new messages