Skip to content

Commit afc8b14

Browse files
committed
Example: Flat Surface
1 parent de623a1 commit afc8b14

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

examples/surfaces/surf/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,7 @@ add_executable(example_surf_5 surf_5.cpp)
1414
target_link_libraries(example_surf_5 PUBLIC matplot)
1515

1616
add_executable(example_surf_6 surf_6.cpp)
17-
target_link_libraries(example_surf_6 PUBLIC matplot)
17+
target_link_libraries(example_surf_6 PUBLIC matplot)
18+
19+
add_executable(example_surf_7 surf_7.cpp)
20+
target_link_libraries(example_surf_7 PUBLIC matplot)

examples/surfaces/surf/surf_7.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#include <cmath>
2+
#include <matplot/matplot.h>
3+
4+
int main() {
5+
using namespace matplot;
6+
auto [X, Y] = meshgrid(iota(1, .5, 10), iota(1, 20));
7+
auto Z = transform(X, Y, [](double, double) { return 5.; });
8+
surf(X, Y, Z);
9+
10+
show();
11+
return 0;
12+
}

0 commit comments

Comments
 (0)