当前位置:网站首页>GGHIGHLIGHT: EASY WAY TO HIGHLIGHT A GGPLOT IN R
GGHIGHLIGHT: EASY WAY TO HIGHLIGHT A GGPLOT IN R
2022-07-02 11:50:00 【Xiaoyu 2022】
library(tidyverse)
library(gghighlight)
theme_set(theme_bw())
p <- ggplot(
airquality,
aes(Day, Temp, group = Month, color = factor(Month))
) +
geom_line() +
scale_color_viridis_d() +
labs(x = "Day of Month", y = "Temperature") +
theme(legend.position = "top")
p

library(tidyverse)
library(gghighlight)
theme_set(theme_bw())
p <- ggplot(
airquality,
aes(Day, Temp, group = Month, color = factor(Month))
) +
geom_line() +
scale_color_viridis_d() +
labs(x = "Day of Month", y = "Temperature") +
theme(legend.position = "top")
p + gghighlight(max(Temp) > 93, label_key = Month)

library(tidyverse)
library(gghighlight)
theme_set(theme_bw())
ggplot(iris, aes(Sepal.Length, fill = Species)) +
geom_histogram(bins = 30) +
scale_fill_viridis_d() +
gghighlight() +
facet_wrap(~ Species)

library(tidyverse)
library(gghighlight)
df <- mtcars %>% mutate(name = row.names(.))
df %>%
ggplot(aes(mpg, disp)) +
geom_point(col = "darkred") +
gghighlight(disp > 350 & disp <= 400,
unhighlighted_colour = alpha("steelblue", 0.4),
use_direct_label = TRUE,
label_key = name,
label_params = list(size = 5)) +
geom_point(col = "darkred", size = 2.5)

library(tidyverse)
library(gghighlight)
df <- mtcars %>% mutate(name = row.names(.))
ggplot(df, aes(name, mpg)) +
geom_col() +
theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
gghighlight(mpg > 25)
边栏推荐
- R HISTOGRAM EXAMPLE QUICK REFERENCE
- 文件操作(详解!)
- Some things configured from ros1 to ros2
- Is the Ren domain name valuable? Is it worth investing? What is the application scope of Ren domain name?
- Is it safe to open a stock account through the QR code of the securities manager? Or is it safe to open an account in a securities company?
- 基于Hardhat和Openzeppelin开发可升级合约(二)
- MySQL stored procedure cursor traversal result set
- 时间格式化显示
- Programmer growth Chapter 6: how to choose a company?
- 可升级合约的原理-DelegateCall
猜你喜欢

Compilation errors and printout garbled problems caused by Chinese content in vs2019 code

A sharp tool for exposing data inconsistencies -- a real-time verification system

Amazon cloud technology community builder application window opens

K-Means Clustering Visualization in R: Step By Step Guide

Cluster Analysis in R Simplified and Enhanced

The computer screen is black for no reason, and the brightness cannot be adjusted.

How to Create a Nice Box and Whisker Plot in R

GGPLOT: HOW TO DISPLAY THE LAST VALUE OF EACH LINE AS LABEL

FLESH-DECT(MedIA 2021)——一个material decomposition的观点

GGPLOT: HOW TO DISPLAY THE LAST VALUE OF EACH LINE AS LABEL
随机推荐
Amazon cloud technology community builder application window opens
YYGH-9-预约下单
Take you ten days to easily finish the finale of go micro services (distributed transactions)
ESP32存储配网信息+LED显示配网状态+按键清除配网信息(附源码)
数据分析 - matplotlib示例代码
YYGH-10-微信支付
How to Easily Create Barplots with Error Bars in R
BEAUTIFUL GGPLOT VENN DIAGRAM WITH R
Some problems encountered in introducing lvgl into esp32 Arduino
How to Add P-Values onto Horizontal GGPLOTS
Eight sorting summaries
Beautiful and intelligent, Haval H6 supreme+ makes Yuanxiao travel safer
map集合赋值到数据库
Basic usage of MySQL in centos8
预言机链上链下调研
TDSQL|就业难?腾讯云数据库微认证来帮你
bedtools使用教程
excel表格中选中单元格出现十字带阴影的选中效果
PX4 Position_Control RC_Remoter引入
文件操作(详解!)
