【R包】tidyplots----取代ggplot2的科研绘图利器

server/2025/2/25 22:36:31/

文章目录

    • 介绍
    • 安装
    • Usage
    • 文档
    • 参考

在这里插入图片描述

介绍

tidyplots----取代ggplot2的科研绘图利器。tidyplots的目标是简化为科学论文准备出版的情节的创建。它允许使用一致和直观的语法逐渐添加,删除和调整情节组件。

在这里插入图片描述

安装

You can install the released version of tidyplots from CRAN with:

install.packages("tidyplots")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("jbengler/tidyplots")

Usage

Here are some examples. Also have a look at the getting started guide and the full documentation.

library(tidyplots)study |> tidyplot(x = treatment, y = score, color = treatment) |> add_mean_bar(alpha = 0.4) |> add_sem_errorbar() |> add_data_points_beeswarm()

在这里插入图片描述

energy |> tidyplot(x = year, y = energy, color = energy_source) |> add_barstack_absolute()

在这里插入图片描述

energy |> dplyr::filter(year %in% c(2005, 2010, 2015, 2020)) |> tidyplot(y = energy, color = energy_source) |> add_donut() |> split_plot(by = year)

在这里插入图片描述

energy_week |> tidyplot(x = date, y = power, color = energy_source) |> add_areastack_absolute()

在这里插入图片描述

energy_week |> tidyplot(x = date, y = power, color = energy_source) |> add_areastack_relative()

在这里插入图片描述

study |> tidyplot(x = group, y = score, color = dose) |> add_mean_bar(alpha = 0.4) |> add_mean_dash() |> add_mean_value()

在这里插入图片描述

time_course |>tidyplot(x = day, y = score, color = treatment) |>add_mean_line() |>add_mean_dot() |>add_sem_ribbon()

在这里插入图片描述

climate |>tidyplot(x = month, y = year, color = max_temperature) |>add_heatmap()

在这里插入图片描述

study |> tidyplot(x = treatment, y = score, color = treatment) |> add_boxplot() |> add_test_pvalue(ref.group = 1)

在这里插入图片描述

gene_expression |> dplyr::filter(external_gene_name %in% c("Apol6", "Col5a3", "Vgf", "Bsn")) |> tidyplot(x = condition, y = expression, color = sample_type) |> add_mean_dash() |> add_sem_errorbar() |> add_data_points_beeswarm() |> add_test_asterisks(hide_info = TRUE) |> remove_x_axis_title() |> split_plot(by = external_gene_name)

在这里插入图片描述

study |> tidyplot(x = treatment, y = score, color = treatment) |> add_mean_bar(alpha = 0.4) |> add_sem_errorbar() |> add_data_points_beeswarm() |> view_plot(title = "Default color scheme: 'friendly'") |> adjust_colors(colors_discrete_apple) |> view_plot(title = "Alternative color scheme: 'apple'")

在这里插入图片描述

在这里插入图片描述

文档

  • Package index
    Overview of all tidyplots functions

  • Get started
    Getting started guide

  • Visualizing data
    Article with examples for common data visualizations

  • Advanced plotting
    Article about advanced plotting techniques and workflows

  • Color schemes
    Article about the use of color schemes

参考

  • https://github.com/jbengler/tidyplots/
  • https://jbengler.github.io/tidyplots/
  • https://blog.csdn.net/qq_21478261/article/details/143786774

http://www.ppmy.cn/server/170624.html

相关文章

python脚本实现接入企微机器人

企业微信中的群聊机器人在日常办公中无处不在,对提升工作效率、保证消息及时送达提供了重要的技术保障。例如:DevOps助手、JIRA、构建通知等;还常常使用在运维服务器中配合Prometheus监控体系及时发送告警信息等 文章目录 源码示例Demo源码处…

AWS云从业者认证题库 AWS Cloud Practitioner(2.21)

题库持续更新,上方二维码查看完整题库! 公司希望减少开发人员用于运行代码的物理计算资源,通过启用无服务器架构,哪种服务可以满足该需求? A: Amazon Elastic Compute Cloud (Amazon EC2) B: AWS Lambda C&#xff1a…

Vosk语音识别包

Vosk介绍 Vosk作为一款开源的离线语音识别工具包,其核心特点可归纳为以下五个方面,结合多篇技术文档的实践与分析 一、离线高效识别 完全脱离网络依赖:所有语音处理均在本地完成,无需云端数据传输,既保障隐私安全又…

【quicker】调节PPT指定字号字体大小/快速调节WPS的PPT字体大小

在quicker的拓展动作中找不到直接指定字号大小方式的动作。 换个思路,既然无法通过alt键模拟,不如模拟右键菜单触发?尝试过失败了 所以有了第三种方法 ,首先给字体窗口设置快捷键,此处设置的是altshiftf,然…

Qt学习 网络编程 TPC通信

一 基本网络端口 1 网络编程基本概念 通讯方式:信息的通讯时通过网络来进行,通讯方式有两种,TCP和UDP通信,TCP通讯是专用通道,指定某个信息只能走某个通道,UDP则是非专用通道,比如一个车队&am…

Docker Hub 使用规则与限制全解析

在容器化技术风靡的当下,Docker 无疑是其中的佼佼者,而 Docker Hub 作为其核心生态的重要组成部分,是无数开发者获取镜像、分享容器化应用的关键平台。不过,你真的了解如何在规则范围内充分利用它吗?今天,咱…

RTSP协议

一、RTSP 协议概述 RTSP(Real-Time Streaming Protocol)是一种应用层协议,用于控制实时流媒体传输(如视频点播、直播)。它本身不传输媒体数据,而是通过协商建立媒体会话,并通过 RTP/RTCP 协议传…

MySQL自动备份脚本

MySQL自动备份脚本 mysqldump命令将数据库中的数据备份成一个文本文件,表的结构和数据将存储在生成的文本文件中 基本语法 备份一个数据库下的多个表 # 备份一个数据库下的多个表# username表示用户名 # pwd表示密码 # localhost为数据库地址 # dbname表示数据库…