This is an example for the Rectangle geometry
Output
#include <fstream>
#include <random>
int main() {
std::vector<float> xmin = {1, 3, 1, 5, 4};
std::vector<float> ymin = {1, 1, 4, 1, 3};
std::vector<float> xmax = {2, 4, 3, 6, 6};
std::vector<float> ymax = {2, 2, 5, 3, 5};
std::vector<float> fill = {0, 0, 0, 1, 1};
auto ax = fig->axis();
auto data =
create_data().xmin(xmin).ymin(ymin).xmax(xmax).ymax(ymax).fill(fill);
auto rect = ax->rectangle(data);
ax->xlabel("x");
ax->ylabel("y");
#ifdef TRASE_EXAMPLES_SVG_BACKEND
std::ofstream out;
out.open("example_rectangle.svg");
fig->draw(backend);
out.close();
#endif
#ifdef TRASE_EXAMPLES_GL_BACKEND
fig->show(backend);
#endif
}