Vindaar / ggplotnim

A port of ggplot2 for Nim
https://vindaar.github.io/ggplotnim
MIT License
177 stars 15 forks source link

allow setting a scale manually as discrete or continuous #35

Closed Vindaar closed 4 years ago

Vindaar commented 4 years ago

In order to override the determination of the discreteness, an additional field was added, which can be set via the scale_*_continuous procs.

The recipe rBarPlotCompStats.nim is an example for this where we (unnecessarily) parse channel numbers to integers before creating a bar plot with channels on the x axis.

It also shows how to plot a bar plot with previously computed stats.

Note: there's obviously limitations as to when setting the discreteness manually can work. Trying to set a scale containing string values as continuous will likely just result in an exception / assertion error / crash for instance.

TODO: need to add data file and add recipe to tCompareRecipes.nim!