當條的數量很大時(當天/周在 x 軸上時),條之間的空間不可見。

但是當條的數量很少時(當月份在 x 軸上時),條之間的空間是可見的。

我想要的是不管條的數量,條之間的空間應該是可見的。請在 R 中編碼的任何想法?
uj5u.com熱心網友回復:
您可以colour = "white"在條形周圍添加邊框:
library(tidyverse)
df <- tibble(x = rep(1:100, 5))
df |>
ggplot(aes(x))
geom_histogram()
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

df |>
ggplot(aes(x))
geom_histogram(colour = "white")
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

由reprex 包創建于 2022-05-17 (v2.0.1)
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/477069.html
