Ranges
The plotting functions work on any range of elements convertible to double. For instance, we can create a line plot from a set of elements by
1 2 | |
Any object that has the functions begin and end are considered iterable ranges. Most axes object subclasses use vector<double> or vector<vector<double>> to store their data. For convenience, the common.h header file includes the aliases vector_1d and vector_2d to these data types.
These conversions also work on ranges of ranges:
1 2 | |
Unfortunately, because of how templated functions work, one exception is initializer lists. Initializer lists only work for functions that are explicitly defined for them.