trase
Points Geometry

This is an example for the points geometry which uses the classic Iris data set

example_points.svg
Output
#include "trase.hpp"
#include <fstream>
#include <random>
using namespace trase;
int main() {
auto csv = dl.download(
"http://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data",
{"sepal_length", "sepal_width", "petal_length", "petal_width", "class"});
auto fig = figure();
auto ax = fig->axis();
auto data = create_data()
.x(csv["sepal_length"])
.y(csv["sepal_width"])
.color(csv["petal_width"]);
auto points = ax->points(data);
ax->xlabel("sepal length");
ax->ylabel("sepal width");
// output to chosen backend
#ifdef TRASE_EXAMPLES_SVG_BACKEND
std::ofstream out;
out.open("example_points.svg");
BackendSVG backend(out);
fig->draw(backend);
out.close();
#endif
#ifdef TRASE_EXAMPLES_GL_BACKEND
BackendGL backend;
fig->show(backend);
#endif
}