Telegram Group & Telegram Channel
On bubbles and trees 💫

Teun van den Brand делает просто волшебные дополнения к ggplot2, в частности, библиотека {legendry} теперь позволяет делать пузырьковые легенды для графиков.


library(legendry)

gapminder::gapminder |>
dplyr::filter(year == max(year)) |>
ggplot(aes(gdpPercap, lifeExp, size = pop,
fill = continent)) +
geom_point(pch = 21, alpha = 0.8) +
scale_size_area(
limits = c(0, NA), max_size = 20,
breaks = c(0, 100, 500, 1000)*1e6,
labels = c(0, "100M", "500M", "1B"),
guide = guide_circles(vjust = 1)
) +
scale_fill_discrete(guide =
guide_legend(override.aes =
list(size = 4, alpha = 0.8))) +
scale_x_log10() +
labs(
x = "ВВП на душу населения",
y = "Ожидаемая продолжительность жизни",
fill = "Континент",
size = "Население"
)


Это должно быть по умолчанию в {ggplot2}!



group-telegram.com/naukaidannye/707
Create:
Last Update:

On bubbles and trees 💫

Teun van den Brand делает просто волшебные дополнения к ggplot2, в частности, библиотека {legendry} теперь позволяет делать пузырьковые легенды для графиков.


library(legendry)

gapminder::gapminder |>
dplyr::filter(year == max(year)) |>
ggplot(aes(gdpPercap, lifeExp, size = pop,
fill = continent)) +
geom_point(pch = 21, alpha = 0.8) +
scale_size_area(
limits = c(0, NA), max_size = 20,
breaks = c(0, 100, 500, 1000)*1e6,
labels = c(0, "100M", "500M", "1B"),
guide = guide_circles(vjust = 1)
) +
scale_fill_discrete(guide =
guide_legend(override.aes =
list(size = 4, alpha = 0.8))) +
scale_x_log10() +
labs(
x = "ВВП на душу населения",
y = "Ожидаемая продолжительность жизни",
fill = "Континент",
size = "Население"
)


Это должно быть по умолчанию в {ggplot2}!

BY Наука и данные




Share with your friend now:
group-telegram.com/naukaidannye/707

View MORE
Open in Telegram


Telegram | DID YOU KNOW?

Date: |

Perpetrators of such fraud use various marketing techniques to attract subscribers on their social media channels. Although some channels have been removed, the curation process is considered opaque and insufficient by analysts. Asked about its stance on disinformation, Telegram spokesperson Remi Vaughn told AFP: "As noted by our CEO, the sheer volume of information being shared on channels makes it extremely difficult to verify, so it's important that users double-check what they read." Crude oil prices edged higher after tumbling on Thursday, when U.S. West Texas intermediate slid back below $110 per barrel after topping as much as $130 a barrel in recent sessions. Still, gas prices at the pump rose to fresh highs. And indeed, volatility has been a hallmark of the market environment so far in 2022, with the S&P 500 still down more than 10% for the year-to-date after first sliding into a correction last month. The CBOE Volatility Index, or VIX, has held at a lofty level of more than 30.
from ru


Telegram Наука и данные
FROM American