Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to draw scatter plot and mosaic density Diagram by ggplot2

Shulou Source: shulou.com Published: 2022-06-01 01:53:21 09月12日 Update

Ggplot2 how to draw scatter plot splicing density map, I believe that many inexperienced people do not know what to do, so this paper summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

Image.png

A few days ago, a reader left a message on the official account and asked how the above picture should be realized. I thought of a way to use ggplot2 to draw scatter plot and density diagram respectively, and then use aplot package to do the puzzle. Aplot package is a new package developed by the author of ggtree. A very important role is to solve the problem of axis alignment in jigsaw puzzles. The usage of this aplot package you can search aplot directly in Wechat search to find the introduction of the original author's tweet, and this official account often pushes the learning content of R language, very good, the author is a real god-level figure.

Aplot package: allows you to draw more complex pictures

All right, let's start to introduce the specific implementation process.

The first is the simulation data.

Generate two columns of data that conform to normal distribution, and then combine them into a data box

X

Tags: Density data next content question author public method more color complex important helpless to this end three characters functions methods original works original authors Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Microsoft OPPO Reno Huawei vpn