1
0

modern.cpp 326 B

1234567891011121314
  1. #include "../matplotlibcpp.h"
  2. namespace plt = matplotlibcpp;
  3. int main()
  4. {
  5. // plot(y) - the x-coordinates are implicitly set to [0,1,...,n)
  6. plt::plot({1,2,3,1,3.5,2.5});
  7. // plot(x,y,format) - plot as solid red line with circular markers
  8. plt::plot({5,4,3,2,-1}, {-1, 4, 2, 7, 1}, "ro-");
  9. // show plots
  10. plt::show();
  11. }