Skip to content

handle aes( ... = NULL) appropriately #1139

Open
@smouksassi

Description

@smouksassi

ggplotly does not accept aesthetics with NULL assignment.
Use case in a programmatic big app I have a code that assigns aesthetics globally then turn off the aesthetics for some layers.
There are some workarounds but my issue I am filing in here is to handle correctly the aes ( ... = NULL)

require(ggplot2)
require(plotly)

plottest<- ggplot(mtcars,aes(mpg,disp))+
  aes(group=cyl)+
  geom_line()+
  geom_smooth(aes(group=NULL))

ggplotly(plottest)

plotfixed<- ggplot(mtcars,aes(mpg,disp))+
  geom_line(aes(group=cyl) )+
  geom_smooth()

ggplotly(plotfixed)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions