I have often been unhappy that the line type in a #ggplot2 legend is not clearly visible. Today, I found a simple solution: simply use
theme(legend.key.width = unit(1, "cm"))
Replace 1 with any other value that you like (not too small, of course!).
Anyone an idea where I can find the source code of ardata.fr/ggiraph-book/ ? The github link on the website is dead. #ggplot2 #rstats #ggiraph. Thanks!
ggiraph-book
Now on CRAN, ggdiagram is a #ggplot2 extension that draws diagrams programmatically in #Rstats. Allows for precise control in how objects, labels, and equations are placed in relation to each other.
https://wjschne.github.io/ggdiagram/articles/ggdiagram.html
I had the pleasure of curating this week's #TidyTuesday data about Scottish Munros So the chart just had to be an annotated, snow-capped, density mountain!
Code: https://github.com/nrennie/tidytuesday/tree/main/2025/2025-08-19
Level up your data science skills this September at posit::conf(2025)! Learn to tell a better story with data in our "Data Talks" or "Mastering Data Visualization with ggplot2" workshops.
Join us! Register now: https://posit.co/conference/
Sept 16–18 | Atlanta
This week's #TidyTuesday looks at data from Our World in Data on the Gini coefficient (a measure of income inequality) before and after tax
I quite like this style of small multiple chart when there are lots of categories - a zoomed in version with more explanation, then more minimalist versions for the smaller versions. It helps avoiding too much clutter, whilst still giving the extra information users need!
Code: https://github.com/nrennie/tidytuesday/tree/main/2025/2025-08-05
It’s an oldie but goodie and just saved me a bunch of heartache now. #RStats #ggplot2
Taking Control of Plot Scaling
https://www.tidyverse.org/blog/2020/08/taking-control-of-plot-scaling/
New presentation just posted at today's @useR_conf virtual conference: Plot Twist: Adding Interactivity to the Elegance of ggplot2 with ggiraph
Na #PythonCerrado2025, tivemos ontem um excelente tutorial do Lucas Marcondes Pavelski https://github.com/lucasmpavelski.
Aprendemos sobre #R, #tidyverse, #reticulate, várias ferramentas essenciais como #ggplot2 e #dplyr, vendo na prática como aplicá-las. Foco na ponte #Python <-> R.
Tudo novidade pra mim, vieram várias ideias interessantes de análises e plots.
For this week's #TidyTuesday, I decided to recreate the most watched movies chart from Netflix's "What We Watched the First Half of 2025" report (which took longer than I thought it would!)
{ggpattern} for image-filled bars
{imager} for adding lilac fade to images
{elementalist} for rounded corners
Code: https://github.com/nrennie/tidytuesday/tree/main/2025/2025-07-29
I recently saw a kind of stacked donut/pie chart that visualized nested count data (e.g. a sample description with two relevant categories, like favorite ice cream and gender) and wondered how I'd do that in #rstats.
So, if you ever want to make a plot like this, here's the #ggplot2 and #dplyr code: https://gist.github.com/Kudusch/577b6f07c686a64a3aace685fd9f3bee
This wouldn't work well with too many categories and pie charts in general aren't optimal, but for this specific kind/shape of data, I think it works well enough.
Looking forward to giving a 4-hour workshop on #dataviz at the First Summer School on Linguistic Creativity in Bielefeld tomorrow! #Vorfreude
UPDATE
That was a lot of fun and we manage to cover a lot in four hours! The slides can be found here (but please note that they are not intended as self-learning materials): https://elenlefoll.quarto.pub/2025-bielefeld-dataviz and the practical #ggplot2 part was based on Chapter 10 of my in-progress textbook: https://elenlefoll.github.io/RstatsTextbook/10_Dataviz.html.