Browse Source

Update minimal example to show a non-straight line.

Benno Evers 7 years ago
parent
commit
f994996e07
3 changed files with 5 additions and 2 deletions
  1. 1 1
      README.md
  2. 4 1
      examples/basic.cpp
  3. BIN
      examples/minimal.png

+ 1 - 1
README.md

@@ -13,7 +13,7 @@ Complete minimal example:
 #include "matplotlibcpp.h"
 namespace plt = matplotlibcpp;
 int main() {
-    plt::plot({1,2,3,4});
+    plt::plot({1,3,2,4});
     plt::show();
 }
 ```

+ 4 - 1
examples/basic.cpp

@@ -1,4 +1,5 @@
 #define _USE_MATH_DEFINES
+#include <iostream>
 #include <cmath>
 #include "../matplotlibcpp.h"
 
@@ -30,5 +31,7 @@ int main()
 	// Enable legend.
 	plt::legend();
 	// save figure
-	plt::save("./basic.png");
+	const char* filename = "./basic.png";
+	std::cout << "Saving result to " << filename << std::endl;;
+	plt::save(filename);
 }

BIN
examples/minimal.png