-
Notifications
You must be signed in to change notification settings - Fork 164
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
ggbarplot: Multiple groups with error bars only work with color argument #71
Comments
I've had the same problem. |
For customizing the error bar, you should specify the argument ggbarplot(df,
x = "condition",
y = "iq",
fill = "time",
palette = "grey",
add = "mean_se", add.params = list(color = "time"),
position = position_dodge(0.8)) |
Your code doesn't work like its supposed to. It still produces error bars in the same color as the barplot, which makes it impossible to see the lower half. What I want is this:
The problem wouldn't exist, if the |
Same problem here. |
With the latest developmental version of ggpubr, you can do this: # Required packages and demo data
library(tidyverse)
library(ggpubr)
df <- tibble(
iq = rnorm(100, 100, 15),
condition = rep(c("A", "B"), each = 50),
time = rep(c("t1", "t2", "t1", "t2"), each = 25)
)
# Visualization
ggbarplot(df, x = "condition", y = "iq",
fill = "time", palette = "grey",
add = "mean_se", add.params = list(group = "time"),
position = position_dodge(0.8))
|
Works like a charm - thanks! |
so we can close the issue |
It does not work for me. |
You have to install the current development version via
|
Problem solved. Thanks! |
Merci beaucoup ! |
Yielddata.xlsx |
Hello,
This adds the points in different columns AFTER the bars of each group Here are the top 15 lines of the melted_fig4a.dmso I would very much appreciate your help Eleni |
Try this
plot<- ggbarplot(datamay, x = "Treatment",
y = "Corg", add = "mean_se", add.params=list(group = "Fraction", *color =
"black"* ),
color ="Fraction", fill= "Fraction",
palette=c("darkgoldenrod4", "darkolivegreen4"),
ylim=c(0,60))
Thanks & Regards,
डॉ दिनेश कुमार (पीएचडी) / Dr. DINESH KUMAR (PhD)
वैज्ञानिक (सस्य विज्ञान) / Scientist (Agronomy)
भा॰कृ॰अनु॰प॰ - भारतीय मृदा एवं जल संरक्षण संस्थान, अनुसंधान केंद्र, दतिया,
मध्य प्रदेश, भारत, 475661 / ICAR-Indian Institute of Soil and Water
Conservation, Research Centre Datia, Madhya Pradesh, India, 475661
मोबाइल / Mob: 7877172907, 8140486460
ई मेल / Email: ***@***.*** ***@***.***>com* |
***@***.***
***@***.***>*
ResearchGate <https://www.researchgate.net/profile/Dinesh_Kumar520> | ORCID
<https://orcid.org/0000-0002-0505-9023> | GoogleScholar
<https://scholar.google.com/citations?hl=en&user=KX59L-oAAAAJ> |
Pubslon/WebOfScience <https://publons.com/researcher/1323156/dinesh-kumar/>
| SciProfiles <https://sciprofiles.com/profile/dkagro1991>
…On Tue, May 23, 2023 at 8:50 PM marinaaa118 ***@***.***> wrote:
Hey!
I'm still getting the error bars of the same color as the groups, even
though I installed the development version that you mention. I'm specifying
the colors, I don't know i that might be the problem. However I tried with
the grey palette and others and still getting the same color.
This is the code:
plot<- ggbarplot(datamay, x = "Treatment",
y = "Corg", add = "mean_se", add.params=list(group = "Fraction"),
color ="Fraction", fill= "Fraction",
palette=c("darkgoldenrod4", "darkolivegreen4"),
ylim=c(0,60))
Any tips? Thanks in advance!
Marina.
—
Reply to this email directly, view it on GitHub
<#71 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALIO6QYX3DWMV7XKQEVTAOTXHTITRANCNFSM4EU4SYDA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Thanks a lot!
I already had made it work, hence I deleted the comment.
Is it possible to customize the error bars? I tried using size in
add.params but nothing happens.
Thanks and regards,
El mié, 24 may 2023 a las 6:44, dkagro1991 ***@***.***>)
escribió:
… Try this
plot<- ggbarplot(datamay, x = "Treatment",
y = "Corg", add = "mean_se", add.params=list(group = "Fraction", *color =
"black"* ),
color ="Fraction", fill= "Fraction",
palette=c("darkgoldenrod4", "darkolivegreen4"),
ylim=c(0,60))
Thanks & Regards,
डॉ दिनेश कुमार (पीएचडी) / Dr. DINESH KUMAR (PhD)
वैज्ञानिक (सस्य विज्ञान) / Scientist (Agronomy)
भा॰कृ॰अनु॰प॰ - भारतीय मृदा एवं जल संरक्षण संस्थान, अनुसंधान केंद्र, दतिया,
मध्य प्रदेश, भारत, 475661 / ICAR-Indian Institute of Soil and Water
Conservation, Research Centre Datia, Madhya Pradesh, India, 475661
मोबाइल / Mob: 7877172907, 8140486460
ई मेल / Email: ***@***.*** ***@***.***>com* |
***@***.***
***@***.***>*
ResearchGate <https://www.researchgate.net/profile/Dinesh_Kumar520> |
ORCID
<https://orcid.org/0000-0002-0505-9023> | GoogleScholar
<https://scholar.google.com/citations?hl=en&user=KX59L-oAAAAJ> |
Pubslon/WebOfScience <https://publons.com/researcher/1323156/dinesh-kumar/
>
| SciProfiles <https://sciprofiles.com/profile/dkagro1991>
On Tue, May 23, 2023 at 8:50 PM marinaaa118 ***@***.***>
wrote:
> Hey!
>
> I'm still getting the error bars of the same color as the groups, even
> though I installed the development version that you mention. I'm
specifying
> the colors, I don't know i that might be the problem. However I tried
with
> the grey palette and others and still getting the same color.
>
> This is the code:
>
> plot<- ggbarplot(datamay, x = "Treatment",
> y = "Corg", add = "mean_se", add.params=list(group = "Fraction"),
> color ="Fraction", fill= "Fraction",
> palette=c("darkgoldenrod4", "darkolivegreen4"),
> ylim=c(0,60))
>
> Any tips? Thanks in advance!
>
> Marina.
>
> —
> Reply to this email directly, view it on GitHub
> <#71 (comment)
>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/ALIO6QYX3DWMV7XKQEVTAOTXHTITRANCNFSM4EU4SYDA
>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
—
Reply to this email directly, view it on GitHub
<#71 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BABPF5FZM6XI43T3QDCJVLTXHWGZHANCNFSM4EU4SYDA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
What kind of customization do you want to do?
Do you want to change the position? or is it about the width of the error
bar?
Thanks & Regards,
डॉ दिनेश कुमार (पीएचडी) / Dr. DINESH KUMAR (PhD)
वैज्ञानिक (सस्य विज्ञान) / Scientist (Agronomy)
भा॰कृ॰अनु॰प॰ - भारतीय मृदा एवं जल संरक्षण संस्थान, अनुसंधान केंद्र, दतिया,
मध्य प्रदेश, भारत, 475661 / ICAR-Indian Institute of Soil and Water
Conservation, Research Centre Datia, Madhya Pradesh, India, 475661
मोबाइल / Mob: 7877172907, 8140486460
ई मेल / Email: ***@***.*** ***@***.***>com* |
***@***.***
***@***.***>*
ResearchGate <https://www.researchgate.net/profile/Dinesh_Kumar520> | ORCID
<https://orcid.org/0000-0002-0505-9023> | GoogleScholar
<https://scholar.google.com/citations?hl=en&user=KX59L-oAAAAJ> |
Pubslon/WebOfScience <https://publons.com/researcher/1323156/dinesh-kumar/>
| SciProfiles <https://sciprofiles.com/profile/dkagro1991>
On Thu, May 25, 2023 at 3:04 PM marinaaa118 ***@***.***>
wrote:
… Thanks a lot!
I already had made it work, hence I deleted the comment.
Is it possible to customize the error bars? I tried using size in
add.params but nothing happens.
Thanks and regards,
El mié, 24 may 2023 a las 6:44, dkagro1991 ***@***.***>)
escribió:
> Try this
>
> plot<- ggbarplot(datamay, x = "Treatment",
> y = "Corg", add = "mean_se", add.params=list(group = "Fraction", *color =
> "black"* ),
> color ="Fraction", fill= "Fraction",
> palette=c("darkgoldenrod4", "darkolivegreen4"),
> ylim=c(0,60))
>
> Thanks & Regards,
>
> डॉ दिनेश कुमार (पीएचडी) / Dr. DINESH KUMAR (PhD)
> वैज्ञानिक (सस्य विज्ञान) / Scientist (Agronomy)
> भा॰कृ॰अनु॰प॰ - भारतीय मृदा एवं जल संरक्षण संस्थान, अनुसंधान केंद्र,
दतिया,
> मध्य प्रदेश, भारत, 475661 / ICAR-Indian Institute of Soil and Water
> Conservation, Research Centre Datia, Madhya Pradesh, India, 475661
> मोबाइल / Mob: 7877172907, 8140486460
> ई मेल / Email: ***@***.*** ***@***.***>com* |
> ***@***.***
> ***@***.***>*
> ResearchGate <https://www.researchgate.net/profile/Dinesh_Kumar520> |
> ORCID
> <https://orcid.org/0000-0002-0505-9023> | GoogleScholar
> <https://scholar.google.com/citations?hl=en&user=KX59L-oAAAAJ> |
> Pubslon/WebOfScience <
https://publons.com/researcher/1323156/dinesh-kumar/
> >
> | SciProfiles <https://sciprofiles.com/profile/dkagro1991>
>
>
>
>
>
>
>
>
>
> On Tue, May 23, 2023 at 8:50 PM marinaaa118 ***@***.***>
> wrote:
>
> > Hey!
> >
> > I'm still getting the error bars of the same color as the groups, even
> > though I installed the development version that you mention. I'm
> specifying
> > the colors, I don't know i that might be the problem. However I tried
> with
> > the grey palette and others and still getting the same color.
> >
> > This is the code:
> >
> > plot<- ggbarplot(datamay, x = "Treatment",
> > y = "Corg", add = "mean_se", add.params=list(group = "Fraction"),
> > color ="Fraction", fill= "Fraction",
> > palette=c("darkgoldenrod4", "darkolivegreen4"),
> > ylim=c(0,60))
> >
> > Any tips? Thanks in advance!
> >
> > Marina.
> >
> > —
> > Reply to this email directly, view it on GitHub
> > <
#71 (comment)
> >,
> > or unsubscribe
> > <
>
https://github.com/notifications/unsubscribe-auth/ALIO6QYX3DWMV7XKQEVTAOTXHTITRANCNFSM4EU4SYDA
> >
> > .
> > You are receiving this because you commented.Message ID:
> > ***@***.***>
> >
>
> —
> Reply to this email directly, view it on GitHub
> <#71 (comment)
>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/BABPF5FZM6XI43T3QDCJVLTXHWGZHANCNFSM4EU4SYDA
>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
—
Reply to this email directly, view it on GitHub
<#71 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALIO6Q63DMTZJ6DWV7XFTWDXH4RRXANCNFSM4EU4SYDA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
The width of the error bar. I've tried with "width=.2" inside add.params
but it won't work.
Thanks!!!
Marina.
El vie, 26 may 2023 a las 5:37, dkagro1991 ***@***.***>)
escribió:
… What kind of customization do you want to do?
Do you want to change the position? or is it about the width of the error
bar?
Thanks & Regards,
डॉ दिनेश कुमार (पीएचडी) / Dr. DINESH KUMAR (PhD)
वैज्ञानिक (सस्य विज्ञान) / Scientist (Agronomy)
भा॰कृ॰अनु॰प॰ - भारतीय मृदा एवं जल संरक्षण संस्थान, अनुसंधान केंद्र, दतिया,
मध्य प्रदेश, भारत, 475661 / ICAR-Indian Institute of Soil and Water
Conservation, Research Centre Datia, Madhya Pradesh, India, 475661
मोबाइल / Mob: 7877172907, 8140486460
ई मेल / Email: ***@***.*** ***@***.***>com* |
***@***.***
***@***.***>*
ResearchGate <https://www.researchgate.net/profile/Dinesh_Kumar520> |
ORCID
<https://orcid.org/0000-0002-0505-9023> | GoogleScholar
<https://scholar.google.com/citations?hl=en&user=KX59L-oAAAAJ> |
Pubslon/WebOfScience <https://publons.com/researcher/1323156/dinesh-kumar/
>
| SciProfiles <https://sciprofiles.com/profile/dkagro1991>
On Thu, May 25, 2023 at 3:04 PM marinaaa118 ***@***.***>
wrote:
> Thanks a lot!
>
> I already had made it work, hence I deleted the comment.
>
> Is it possible to customize the error bars? I tried using size in
> add.params but nothing happens.
>
> Thanks and regards,
>
> El mié, 24 may 2023 a las 6:44, dkagro1991 ***@***.***>)
> escribió:
>
> > Try this
> >
> > plot<- ggbarplot(datamay, x = "Treatment",
> > y = "Corg", add = "mean_se", add.params=list(group = "Fraction",
*color =
> > "black"* ),
> > color ="Fraction", fill= "Fraction",
> > palette=c("darkgoldenrod4", "darkolivegreen4"),
> > ylim=c(0,60))
> >
> > Thanks & Regards,
> >
> > डॉ दिनेश कुमार (पीएचडी) / Dr. DINESH KUMAR (PhD)
> > वैज्ञानिक (सस्य विज्ञान) / Scientist (Agronomy)
> > भा॰कृ॰अनु॰प॰ - भारतीय मृदा एवं जल संरक्षण संस्थान, अनुसंधान केंद्र,
> दतिया,
> > मध्य प्रदेश, भारत, 475661 / ICAR-Indian Institute of Soil and Water
> > Conservation, Research Centre Datia, Madhya Pradesh, India, 475661
> > मोबाइल / Mob: 7877172907, 8140486460
> > ई मेल / Email: ***@***.*** ***@***.***>com* |
> > ***@***.***
> > ***@***.***>*
> > ResearchGate <https://www.researchgate.net/profile/Dinesh_Kumar520> |
> > ORCID
> > <https://orcid.org/0000-0002-0505-9023> | GoogleScholar
> > <https://scholar.google.com/citations?hl=en&user=KX59L-oAAAAJ> |
> > Pubslon/WebOfScience <
> https://publons.com/researcher/1323156/dinesh-kumar/
> > >
> > | SciProfiles <https://sciprofiles.com/profile/dkagro1991>
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > On Tue, May 23, 2023 at 8:50 PM marinaaa118 ***@***.***>
> > wrote:
> >
> > > Hey!
> > >
> > > I'm still getting the error bars of the same color as the groups,
even
> > > though I installed the development version that you mention. I'm
> > specifying
> > > the colors, I don't know i that might be the problem. However I tried
> > with
> > > the grey palette and others and still getting the same color.
> > >
> > > This is the code:
> > >
> > > plot<- ggbarplot(datamay, x = "Treatment",
> > > y = "Corg", add = "mean_se", add.params=list(group = "Fraction"),
> > > color ="Fraction", fill= "Fraction",
> > > palette=c("darkgoldenrod4", "darkolivegreen4"),
> > > ylim=c(0,60))
> > >
> > > Any tips? Thanks in advance!
> > >
> > > Marina.
> > >
> > > —
> > > Reply to this email directly, view it on GitHub
> > > <
> #71 (comment)
> > >,
> > > or unsubscribe
> > > <
> >
>
https://github.com/notifications/unsubscribe-auth/ALIO6QYX3DWMV7XKQEVTAOTXHTITRANCNFSM4EU4SYDA
> > >
> > > .
> > > You are receiving this because you commented.Message ID:
> > > ***@***.***>
> > >
> >
> > —
> > Reply to this email directly, view it on GitHub
> > <
#71 (comment)
> >,
> > or unsubscribe
> > <
>
https://github.com/notifications/unsubscribe-auth/BABPF5FZM6XI43T3QDCJVLTXHWGZHANCNFSM4EU4SYDA
> >
> > .
> > You are receiving this because you commented.Message ID:
> > ***@***.***>
> >
>
> —
> Reply to this email directly, view it on GitHub
> <#71 (comment)
>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/ALIO6Q63DMTZJ6DWV7XFTWDXH4RRXANCNFSM4EU4SYDA
>
> .
> You are receiving this because you commented.Message ID:
> ***@***.***>
>
—
Reply to this email directly, view it on GitHub
<#71 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BABPF5AHF3HO34CNBJXOPJDXIAQQHANCNFSM4EU4SYDA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
If one uses fill instead of color, one wouldn't get an error bar within the categories, but a centered error bar for each category on the x-axis. The combination of both arguments is possible though, but it's useless, since one can't see the bottom half of the error bar.
Here's a short reproducable example:
The text was updated successfully, but these errors were encountered: