Skip to content

Increasing line width coloured by y-axis value results in squiggly line #4642

@Michael-Geuenich

Description

@Michael-Geuenich

I want to create a line plot coloured by the value of the y-axis and increase its width. Unfortunately increasing the width results in the squiggles shown in the image below:

image


Removing either the size or color parameter gets rid of the squiggles. Note that this seems to be a windows specific issue, as it seems to work for others on Mac. I'm on windows 10 and R 4.0.3.

library(tidyverse)

df <- tibble(x = seq(-3, 2.99, by = .01))
df$y <- dnorm(df$x)

ggplot(df, aes(x = x, y = y, color = y )) + 
  geom_line(size = 10)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions