Skip to content

geom_bar does not support negative values #64

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
ghost opened this issue Apr 18, 2020 · 2 comments
Closed

geom_bar does not support negative values #64

ghost opened this issue Apr 18, 2020 · 2 comments

Comments

@ghost
Copy link

ghost commented Apr 18, 2020

Issue:

geom_bar does not support plotting with negative heights. Instead, bars with negative heights are rendered as having zero height.

Example:

import ggplotnim

let trials = @["A", "B", "C", "D", "E"]
let values = @[1.0, 0.5, 0, -0.5, -1.0]

var df = newDataFrame()
df["Trial"] = toColumn(trials)
df["Value"] = toColumn(values)

ggplot(df, aes(x="Trial", y="Value")) + 
  geom_bar(stat="identity", position="identity") + 
  ggsave("demo.png")

An equivalent with R/ggplot would produce produce a bar plot with five bars, the first two extending above the x axis, the third sitting on it, and the last two below. However, this snippet instead produces this:

Not right

@Vindaar
Copy link
Owner

Vindaar commented Apr 18, 2020

@Vindaar
Copy link
Owner

Vindaar commented Apr 18, 2020

#65 is merged, closing this.

@Vindaar Vindaar closed this as completed Apr 18, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant