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

Marker Transparency #92

Closed
samhinman opened this issue Aug 16, 2020 · 1 comment
Closed

Marker Transparency #92

samhinman opened this issue Aug 16, 2020 · 1 comment
Labels
aesthetics help wanted Extra attention is needed

Comments

@samhinman
Copy link

Thank you for generating this package - I'm excited about the possibilities it opens for interpreting my data!

I would like to render the datapoints/markers semi-transparent (alpha < 1) so that overplotted data will be easier to visualize. I have attempted using the following arguments, based on code from the readme, tutorial, and manual files, though have not had any luck. I do not receive any errors using the following code, though the transparency of the data points in the plot is not altered.

plot(unpaired_mean_diff, rawplot.type = "swarmplot", palette = c(rgb(0, 0, 0, 0.2), alpha("sienna4", 0.2)))

plot(unpaired_mean_diff, rawplot.type = "swarmplot", palette = c(rgb(0, 0, 0), "sienna4")) + geom.quasirandom(alpha = 0.2)

I have also attempted utilizing the swarmplot.params argument (from geom_quasirandom()link), though receive the error, "Error in plot.dabest_effsize(unpaired_mean_diff, rawplot.type = "swarmplot", : swarmplot.params is not a list."

plot(unpaired_mean_diff, rawplot.type = "swarmplot", palette = c(rgb(0, 0, 0), "sienna4"), swarmplot.params = (alpha = 0.2))

Interestingly, if I change the plot type to "sinaplot", alpha can be changed through the palette argument, though the group width becomes rather thin and is not responsive to the rawplot.groupwidth argument.

plot(unpaired_mean_diff, rawplot.type = "sinaplot", rawplot.groupwidth = 1, palette = c(rgb(0, 0, 0, 0.2), alpha("sienna4", 0.2)))

I am currently toubleshooting through RStudio v1.3.1056 and dabestr v.0.3.0 with the iris dataset. As I'm relatively new to R, I would like to know whether I am missing a simple argument or command, or whether there is a bug and/or workaround? Any advice would be appreciated!

@josesho josesho added aesthetics help wanted Extra attention is needed labels Aug 16, 2020
@samhinman
Copy link
Author

Workaround: Was able to enable marker transparency in the swarmplot by routing through a geom_quasirandom list (via the swarmplot.params argument). Marker size then had to be adjusted in the same list, as it was no longer responsive through the plot() function.

swarmplot.custom.params <- list(alpha = 0.3, size = 3)
plot(unpaired_mean_diff, rawplot.type = "swarmplot", palette = c(rgb(0, 0, 0), "sienna4"), swarmplot.params = swarmplot.custom.params)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aesthetics help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants