8000 fix space · Optimus1072/matplotlib-cpp@85e70fd · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit 85e70fd

Browse files
committed
fix space
1 parent 7df662a commit 85e70fd

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

examples/basic.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,29 @@ namespace plt = matplotlibcpp;
66

77
int main()
88
{
9-
// Prepare data.
10-
int n = 5000;
11-
std::vector<double> x(n), y(n), z(n), w(n,2);
12-
for(int i=0; i<n; ++i) {
13-
x.at(i) = i*i;
14-
y.at(i) = sin(2*M_PI*i/360.0);
15-
z.at(i) = log(i);
16-
}
9+
// Prepare data.
10+
int n = 5000;
11+
std::vector<double> x(n), y(n), z(n), w(n,2);
12+
for(int i=0; i<n; ++i) {
13+
x.at(i) = i*i;
14+
y.at(i) = sin(2*M_PI*i/360.0);
15+
z.at(i) = log(i);
16+
}
1717

18-
// Plot line from given x and y data. Color is selected automatically.
19-
plt::plot(x, y);
20-
// Plot a red dashed line from given x and y data.
21-
plt::plot(x, w,"r--");
22-
// Plot a line whose name will show up as "log(x)" in the legend.
23-
plt::named_plot("log(x)", x, z);
18+
// Plot line from given x and y data. Color is selected automatically.
19+
plt::plot(x, y);
20+
// Plot a red dashed line from given x and y data.
21+
plt::plot(x, w,"r--");
22+
// Plot a line whose name will show up as "log(x)" in the legend.
23+
plt::named_plot("log(x)", x, z);
2424

25-
// Set x-axis to interval [0,1000000]
26-
plt::xlim(0, 1000*1000);
25+
// Set x-axis to interval [0,1000000]
26+
plt::xlim(0, 1000*1000);
2727

2828
// Add graph title
2929
plt::title("sample figure");
30-
// Enable legend.
31-
plt::legend();
32-
// save figure
30+
// Enable legend.
31+
plt::legend();
32+
// save figure
3333
plt::save("./basic.png");
3434
}

0 commit comments

Comments
 (0)
0