int main() { Simple_window win {Point{100, 100}, 800, 600, "Exercise 5"}; const Point orig {300, 300}; constexpr int x_length = 400; constexpr int y_length = 400; const string x_label = "1 == 20 pixels"; const string y_label = "1 == 20 pixels"; constexpr int num_notches = 20; Axis xa {Axis::x, Point{orig.x - x_length / 2, orig.y}, x_length, num_notches, x_label}; Axis ya {Axis::y, Point{orig.x, orig.y + y_length / 2}, y_length, num_notches, y_label}; xa.set_color(Color::red); ya.set_color(Color::red); xa.label.move(-130, -20); constexpr int r_min = -10; constexpr int r_max = 11; constexpr int num_points = 400; constexpr double x_scale = 20; constexpr double y_scale = 20; win.attach(xa); win.attach(ya); for (int n = 1; n < 50; ++n) { ostringstream ss; ss << "Leibniz series approximation; n == " << n; win.set_label(ss.str()); Function leib {[n](double x) { return leibniz(n); }, r_min, r_max, orig, num_points, x_scale, y_scale}; win.attach(leib); win.wait_for_button(); win.detach(leib); } }