| 2 | #include <matplot/matplot.h> |
| 3 | |
| 4 | int main() { |
| 5 | using namespace matplot; |
| 6 | using namespace std; |
| 7 | |
| 8 | vector<double> x = {0, 8, 8, 0}; |
| 9 | vector<double> y = {0, 0, 4, 4}; |
| 10 | polygon(x, y, "g"); |
| 11 | rectangle(0, 0, 2, 4, 0)->fill(true).color("red"); |
| 12 | rectangle(3, 0, 2, 4, 1)->fill(true).color("magenta"); |
| 13 | rectangle(6, 0, 2, 4, 0.5)->fill(true).color("yellow"); |
| 14 | text(2, 2, "Curvature 0")->alignment(labels::alignment::right); |
| 15 | text(4, 2, "Curvature 1")->alignment(labels::alignment::center); |
| 16 | text(6, 2, "Curvature 0.5")->alignment(labels::alignment::left); |
| 17 | arrow(4, 2.2, 3, 3); |
| 18 | textarrow(6, 1, 8, 0, "Last corner"); |
| 19 | |
| 20 | show(); |
| 21 | return 0; |
| 22 | } |