8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b0f57e5 commit a08b67aCopy full SHA for a08b67a
examples/span.cpp
@@ -18,14 +18,7 @@ int main()
18
3, 3, 3, 3
19
};
20
21
- size_t n=sizeof(t)/sizeof(decltype(t[0]));
22
- size_t m=sizeof(data)/sizeof(decltype(data[0]));
23
-
24
- // Use std::span to pass data chunk to plot(), without copying it.
25
- // Unfortunately, plt::plot() makes an internal copy of both x and y
26
- // before passing them to python.
27
- for (size_t offset=0; offset<m; offset+=n)
28
- plt::plot(t, std::span {data+offset, n}, "");
+ plt::plot(span(t, 4), span(data, 12));
29
plt::show();
30
31
plt::detail::_interpreter::kill();
0 commit comments