当前位置:网站首页>R language ggplot2 visualization: align the legend title to the middle of the legend box in ggplot2 (default left alignment, align legend title to middle of legend)
R language ggplot2 visualization: align the legend title to the middle of the legend box in ggplot2 (default left alignment, align legend title to middle of legend)
2022-07-26 09:36:00 【Data+Science+Insight】
R Language ggplot2 visualization : Set legend title (legend title) Align to ggplot2 In the middle of the legend box ( Default left alignment 、align the legend title to the middle of legend box in ggplot2)
# Simulation data
# example data from http://www.cookbook-r.com/Graphs/Legends_(ggplot2)/
df1 <- data.frame(
sex = factor(c("Female","Female","Male","Male")),
time = factor(c("Lunch","Dinner","Lunch","Dinner"), levels=c("Lunch","Dinner")),
total_bill = c(13.53, 16.81, 16.24, 17.42)
)
df1

# Set legend title (legend title) Align to ggplot2 In the middle of the legend box ( Invalid case )
# example data from http://www.cookbook-r.com/Graphs/Leg边栏推荐
猜你喜欢

小程序纪录

2019 ICPC Asia Yinchuan regional (water problem solution)

Neural network and deep learning-6-support vector machine 1-pytorch

图解用户登录验证流程,写得太好了!

Windows backs up the database locally by command

Server and client dual authentication (2)

【Mysql数据库】mysql基本操作集锦-看得会的基础(增删改查)

keepalived 实现mysql自动故障切换

OFDM Lecture 16 - OFDM

The problem of accessing certsrv after configuring ADCs
随机推荐
Process32first returns false, error x message 24
Gauss elimination solves the inverse of matrix (Gauss)
V-for dynamically sets the SRC of img
学习笔记之常用数组api 改变原数组和不改变原数组的有哪些?
Neural network and deep learning-6-support vector machine 1-pytorch
The provincial government held a teleconference on safety precautions against high temperature weather across the province
Table extraction for opencv table recognition (2)
小程序纪录
POJ 1012 Joseph
TabbarController的封装
Custom password input box, no rounded corners
Android implements the caching mechanism and caches multiple data types
ie7设置overflow属性失效解决方法
JS one line code to obtain the maximum and minimum values of the array
解决IE7 & IE8 存储cookie问题
微信小程序开发
copyTo
Process32First返回false,错误x信息24
2019 ICPC Asia Yinchuan regional (water problem solution)
Calling DLL to start thread