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 baba34a commit b8f0c00Copy full SHA for b8f0c00
examples/imshow.cpp
@@ -8,20 +8,20 @@ namespace plt = matplotlibcpp;
8
int main()
9
{
10
// Prepare data
11
- int ncols = 500, nrows = 300;
+ int ncols = 500, nrows = 300;
12
std::vector<float> z(ncols * nrows);
13
- for(int j=0; j<nrows; ++j) {
14
- for(int i=0; i<ncols; ++i) {
+ for (int j=0; j<nrows; ++j) {
+ for (int i=0; i<ncols; ++i) {
15
z.at(ncols * j + i) = std::sin(std::hypot(i - ncols/2, j - nrows/2));
16
}
17
- }
+ }
18
19
const float* zptr = &(z[0]);
20
const int colors = 1;
21
22
plt::title("My matrix");
23
- plt::imshow(zptr, nrows, ncols, colors);
+ plt::imshow(zptr, nrows, ncols, colors);
24
25
- // Show plots
26
- plt::save("imshow.png");
+ // Show plots
+ plt::save("imshow.png");
27
0 commit comments