Skip to content

Commit 3c162ec

Browse files
committed
clang formatted
1 parent 3684e93 commit 3c162ec

File tree

2 files changed

+22
-24
lines changed

2 files changed

+22
-24
lines changed

examples/minimal.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
namespace plt = matplotlibcpp;
44

55
int main() {
6-
plt::plot({1,3,2,4});
7-
plt::show();
6+
plt::plot({1, 3, 2, 4});
7+
plt::show();
88
}

examples/subplot.cpp

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,29 @@
11
#define _USE_MATH_DEFINES
2-
#include <cmath>
32
#include "../matplotlibcpp.h"
3+
#include <cmath>
44

55
using namespace std;
66
namespace plt = matplotlibcpp;
77

8-
int main()
9-
{
10-
// Prepare data
11-
int n = 500;
12-
std::vector<double> x(n), y(n), z(n), w(n,2);
13-
for(int i=0; i<n; ++i) {
14-
x.at(i) = i;
15-
y.at(i) = sin(2*M_PI*i/360.0);
16-
z.at(i) = 100.0 / i;
17-
}
18-
19-
// Set the "super title"
20-
plt::suptitle("My plot");
21-
plt::subplot(1, 2, 1);
22-
plt::plot(x, y, "r-");
23-
plt::subplot(1, 2, 2);
24-
plt::plot(x, z, "k-");
25-
// Add some text to the plot
26-
plt::text(100, 90, "Hello!");
8+
int main() {
9+
// Prepare data
10+
int n = 500;
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;
14+
y.at(i) = sin(2 * M_PI * i / 360.0);
15+
z.at(i) = 100.0 / i;
16+
}
2717

18+
// Set the "super title"
19+
plt::suptitle("My plot");
20+
plt::subplot(1, 2, 1);
21+
plt::plot(x, y, "r-");
22+
plt::subplot(1, 2, 2);
23+
plt::plot(x, z, "k-");
24+
// Add some text to the plot
25+
plt::text(100, 90, "Hello!");
2826

29-
// Show plots
30-
plt::show();
27+
// Show plots
28+
plt::show();
3129
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy