Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

Change Legend Title in ggplot2 in R (Example) | Modify Text of Plot Legends | scale_color_discrete

Автор: Statistics Globe

Загружено: 2022-02-07

Просмотров: 4070

Описание:

How to change the text of a ggplot2 legend in the R programming language. More details: https://statisticsglobe.com/change-le...
R code of this video:

set.seed(2468) # Set seed for reproducibility
data <- data.frame(x = c(runif(200, 0, 2), runif(100, 1, 3)), # Create x variable
y = c(runif(200, 1, 3), runif(100, 2, 4)), # Create y variable
group = c(rep("g1", 200), rep("g2", 100))) # Create group variable

install.packages("ggplot2") # Install ggplot2 package
library("ggplot2") # Load ggplot2 package

my_ggplot <- ggplot(data, aes(x, y, group = group)) + # ggplot2 with 2 legends
geom_point(aes(x, y, color = group))
my_ggplot # Print plot with default legend

my_ggplot + scale_color_discrete(name = "My Legend Title No. 1") # Manual legend title

my_ggplot + labs(color = "My Legend Title No. 2") # Manual legend title

Follow me on Social Media:
Facebook – Statistics Globe Page:   / statisticsglobecom  
Facebook – Group for Discussions & Questions:   / statisticsglobe  
LinkedIn – Statistics Globe Page:   / statisticsglobe  
LinkedIn – Group for Discussions & Questions:   / 12555223  
Twitter:   / joachimschork  

Music by bensound.com

Change Legend Title in ggplot2 in R (Example) | Modify Text of Plot Legends | scale_color_discrete

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

Double group on x axis with ggplot

Double group on x axis with ggplot

Using the ggplot theme function to customize facet labels and your legend (CC067)

Using the ggplot theme function to customize facet labels and your legend (CC067)

Create a Scatter Plot in R with ggplot2 - Labels, Legends and More

Create a Scatter Plot in R with ggplot2 - Labels, Legends and More

R-Studio - GGPlot

R-Studio - GGPlot

Creating a barplot with error bars using ggplot2 (CC088)

Creating a barplot with error bars using ggplot2 (CC088)

Столбчатые диаграммы с {ggplot2}

Столбчатые диаграммы с {ggplot2}

РЫСЬ В ДЕЛЕ... Рысь против волка, койота, змеи, оленя!

РЫСЬ В ДЕЛЕ... Рысь против волка, койота, змеи, оленя!

Реальная Причина, почему Случайные Собаки Подходят к Вам на Улице!

Реальная Причина, почему Случайные Собаки Подходят к Вам на Улице!

Claus Wilke | Spruce up your ggplot2 visualizations with formatted text | RStudio (2020)

Claus Wilke | Spruce up your ggplot2 visualizations with formatted text | RStudio (2020)

ggplot for plots and graphs. An introduction to data visualization using R programming

ggplot for plots and graphs. An introduction to data visualization using R programming

R Programming Tutorial for Beginners (Examples) | Learn Basics | Statistics & Data Science Course

R Programming Tutorial for Beginners (Examples) | Learn Basics | Statistics & Data Science Course

ЛЕКЦИЯ ПРО НАДЁЖНЫЕ ШИФРЫ НА КОНФЕРЕНЦИИ БАЗОВЫХ ШКОЛ РАН В ТРОИЦКЕ

ЛЕКЦИЯ ПРО НАДЁЖНЫЕ ШИФРЫ НА КОНФЕРЕНЦИИ БАЗОВЫХ ШКОЛ РАН В ТРОИЦКЕ

Задача из вступительных Стэнфорда

Задача из вступительных Стэнфорда

Если у тебя спросили «Как твои дела?» — НЕ ГОВОРИ! Ты теряешь свою силу | Еврейская мудрость

Если у тебя спросили «Как твои дела?» — НЕ ГОВОРИ! Ты теряешь свою силу | Еврейская мудрость

Циклы с использованием программирования R

Циклы с использованием программирования R

Creating multipart figures with facets: ggplot2's facet_wrap and facet_grid (CC039)

Creating multipart figures with facets: ggplot2's facet_wrap and facet_grid (CC039)

Positioning and formatting a legend using the ggplot2 R package (CC141)

Positioning and formatting a legend using the ggplot2 R package (CC141)

Твоя ПЕРВАЯ НЕЙРОСЕТЬ на Python с нуля! | За 10 минут :3

Твоя ПЕРВАЯ НЕЙРОСЕТЬ на Python с нуля! | За 10 минут :3

Что наука знает об Иисусе, если он существовал?

Что наука знает об Иисусе, если он существовал?

How to Create a Tree Height Map in R | Example Ft @milos-makes-maps | Visualize Global Forest Canopy

How to Create a Tree Height Map in R | Example Ft @milos-makes-maps | Visualize Global Forest Canopy

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: infodtube@gmail.com