Closed Vindaar closed 3 years ago
The following code produces a broken error bar plot on my machine right now:
var angles = newSeq[int]() var data = newSeq[int]() var err = newSeq[float]() let toUse = if input.len == 0: Data4 else: readDataFile(input) for k, v in tab: angles.add v data.add toUse[k] err.add sqrt(toUse[k].float) let df = seqsToDf({ "Angles" : angles, "Counts" : data, "Error" : err}) .mutate(fn {"yMin" ~ `Counts` - `Error`}, fn {"yMax" ~ `Counts` + `Error`}, fn {"xMin" ~ `Angles` - 7.5}, fn {"xMax" ~ `Angles` + 7.5}) echo df ggplot(df, aes("Angles", "Counts")) + geom_point() + geom_errorbar(aes = aes(xMin = xMin, xMax = xMax)) + geom_errorbar(aes = aes(yMin = yMin, yMax = yMax)) + ggsave("plots/angular.pdf")
The resulting plot:
Another other issue is:
If I do both x and y min/max aesthetic selections in one errorbar call, then the x errors are missing completely!
x
y
https://github.com/Vindaar/ginger/pull/40 will fix a similar bug for the x axis when using xMargin.
xMargin
The following code produces a broken error bar plot on my machine right now:
The resulting plot:
Another other issue is:
If I do both
x
andy
min/max aesthetic selections in one errorbar call, then the x errors are missing completely!