Multiple warnings for ggplot

179 views
Skip to first unread message

Mahmood Naderan

unread,
May 20, 2021, 10:19:29 AM5/20/21
to ggplot2
Hi
For the following command

ggplot(mydata, aes(x = BEN))
+ geom_violin(aes(y = L1, weight = WG), trim = FALSE)
+ geom_dotplot(binaxis='y', stackdir='center', dotsize=0.6)
+ ylim(0, 100)

I get some warning as below

`stat_bindot()` using `bins = 30`. Pick better value with `binwidth`.
Warning messages:
1: In max(f) : no non-missing arguments to max; returning -Inf
2: Computation failed in `stat_bindot()`:
argument must be coercible to non-negative integer
3: Removed 529 rows containing missing values (geom_violin).

Don't know if they have side effects on the generated chart. Specially, the third item talks about removing some rows. While my csv file has about 70 rows, I wonder what is that 529 rows.

Any thought on that?

Regards,
Mahmood

Ron Crump

unread,
May 20, 2021, 10:49:08 AM5/20/21
to ggp...@googlegroups.com
Hi Mahmood,
Without a reproducible example, or your data, it's a bit tricky to
diagnose what might be wrong.

I suggest that you could start by seeing what happens when you do
the two plots (ie with either geom_violin or geom_dotplot) separately,
without the ylim.

I haven't used geom_dotplot, and it looks like the error probably
relates to that, so I'd then play around until I had geom_dotplot doing
what I wanted before trying to combine it with geom_violin. (And I'm
struggling to think how the two plots go together, won't one of the axes
have conflicting scales?).

Best wishes,
Ron.

Mahmood Naderan

unread,
May 20, 2021, 1:12:36 PM5/20/21
to Ron Crump, ggp...@googlegroups.com
Thanks for the hint. In fact when I remove
    ylim(0, 100)

The warning
    Removed 529 rows containing missing values (geom_violin)

Is disappeared. I guess the warning is saying that some values in the kernel density are outside of the range (0,100) and hence they are not shown. I am not sure though...


Regards,
Mahmood





--
--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: https://github.com/hadley/devtools/wiki/Reproducibility

To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2

---
You received this message because you are subscribed to the Google Groups "ggplot2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ggplot2/4f741882-691d-950d-88d7-9c0c9c23aa90%40warwick.ac.uk.
Reply all
Reply to author
Forward
0 new messages