Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 630ba84

Browse files
Benno EversBenno Evers
Benno Evers
authored and
Benno Evers
committed
Some bugfixes and adjustments for contour/spy
1 parent 9ff7a4b commit 630ba84

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

CMakeLists.txt

+8
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ target_include_directories(matplotlib_cpp
1616
target_compile_features(matplotlib_cpp INTERFACE
1717
cxx_std_11
1818
)
19+
# TODO: Use `Development.Embed` component when requiring cmake >= 3.18
1920
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
2021
target_link_libraries(matplotlib_cpp INTERFACE
2122
Python3::Python
@@ -92,6 +93,13 @@ if(Python3_NumPy_FOUND)
9293
add_executable(colorbar examples/colorbar.cpp)
9394
target_link_libraries(colorbar PRIVATE matplotlib_cpp)
9495
set_target_properties(colorbar PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
96+
add_executable(contour examples/contour.cpp)
97+
target_link_libraries(contour PRIVATE matplotlib_cpp)
98+
set_target_properties(contour PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
99+
100+
add_executable(spy examples/spy.cpp)
101+
target_link_libraries(spy PRIVATE matplotlib_cpp)
102+
set_target_properties(spy PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
95103
endif()
96104

97105

examples/spy.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
#import <iostream>
2-
#import <vector>
3-
#import "../matplotlibcpp.h"
1+
#include "../matplotlibcpp.h"
2+
3+
#include <iostream>
4+
#include <vector>
45

56
namespace plt = matplotlibcpp;
67

@@ -26,4 +27,4 @@ int main()
2627
plt::show();
2728

2829
return 0;
29-
}
30+
}

matplotlibcpp.h

-1
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,6 @@ static_assert(sizeof(long long) == 8);
354354
template <> struct select_npy_type<long long> { const static NPY_TYPES type = NPY_INT64; };
355355
static_assert(sizeof(unsigned long long) == 8);
356356
template <> struct select_npy_type<unsigned long long> { const static NPY_TYPES type = NPY_UINT64; };
357-
TODO: add int, long, etc.
358357

359358
template<typename Numeric>
360359
PyObject* get_array(const std::vector<Numeric>& v)

0 commit comments

Comments
 (0)