Skip to content

Provide filled counter-part for geom_step #4695

Closed
@holgerbrandl

Description

@holgerbrandl

To visualize discrete state change progressions, it would be great if geom_step could be extended to also provide a filled counter-part (similar to geom_area).

For a discussion ( including some rather tedious workarounds) see https://stackoverflow.com/questions/21887088/generate-a-filled-geom-step

Currently, with geom_area we get
image

Because of the way geom_area works there are linear interpolations between subsequent points, which are incorrect as they are not reflected in the step-wise nature of the data.

Since the state changes are discrete in nature, geom_step gives a more precise (but visually flawed) picture
image

Example data:
filled_step_data.csv

Example code:

require(tidyverse)

read_csv("filled_step_data.csv") %>%
      ggplot(aes(timestamp, accu_moves)) +
     # geom_step() +
     geom_area()

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