Skip to content

Commit b87d8be

Browse files
committed
matplotlibcpp.h: get it to compile with python >= 3.8, as the C API has changed
1 parent 86e719d commit b87d8be

File tree

5 files changed

+388
-353
lines changed

5 files changed

+388
-353
lines changed

examples/basic.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//
2-
// g++ -g -Wall -o basic -I/usr/include/python3.9 basic.cpp -lpython3.9
3-
// g++ -g -Wall -o basic $(python-config --includes) basic.cpp $(python-config --ldflags --embed)
2+
// g++ -g -Wall -std=c++20 -o basic -I/usr/include/python3.9 basic.cpp -lpython3.9
3+
// g++ -g -Wall -std=c++20 -o basic $(python-config --includes) basic.cpp $(python-config --ldflags --embed)
44
//
55

66
#define _USE_MATH_DEFINES

examples/basic.png

0 Bytes
Loading

examples/imshow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// g++ -g -Wall -o imshow $(python-config --includes) imshow.cpp $(python-config --ldflags --embed)
2+
// g++ -g -Wall -std=c++20 -o imshow $(python-config --includes) imshow.cpp $(python-config --ldflags --embed)
33
//
44

55
#define _USE_MATH_DEFINES

examples/timeseries.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,16 @@ int main()
7272
plt::grid(true);
7373
plt::show();
7474

75-
// Modify some data and plot again, reusing the time array:
76-
for (size_t i=0; i<n; i++) data[i]=i*i-3.0;
75+
// // Modify some data and plot again, reusing the time array:
76+
// for (size_t i=0; i<n; i++) data[i]=i*i-3.0;
77+
78+
// // plt::plot((PyListObject*) tarray, data);
79+
// plt::plot(tarray, data);
80+
// plt::xticks({{"rotation", "20"}});
81+
// plt::title("Quadratic");
82+
// plt::grid(true);
83+
// plt::show();
7784

78-
// plt::plot((PyListObject*) tarray, data);
79-
plt::plot(tarray, data);
80-
plt::xticks({{"rotation", "20"}});
81-
plt::title("Quadratic");
82-
plt::grid(true);
83-
plt::show();
8485

8586
// Unfortunately, we have to call the DateTimeList destructor explicitly
8687
// for now, because the destructor needs an interpreter, which we kill

0 commit comments

Comments
 (0)