MCPcopy Create free account
hub / github.com/alandefreitas/matplotplusplus / main

Function main

examples/data_distribution/boxplot/boxplot_2.cpp:5–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3#include <random>
4
5int main() {
6 using namespace matplot;
7
8 std::vector<double> mpg = {
9 18, 15, 18, 16, 17, 15, 14, 14, 14, 15, 15, 14,
10 15, 14, 24, 22, 18, 21, 27, 26, 25, 24, 25, 26,
11 21, 10, 10, 11, 9, 28, 25, 25, 26, 27, 17.5, 16,
12 15.5, 14.5, 22, 22, 24, 22.5, 29, 24.5, 29, 33, 20, 18,
13 18.5, 17.5, 29.5, 32, 28, 26.5, 20, 13, 19, 19, 16.5, 16.5,
14 13, 13, 13, 28, 27, 34, 31, 29, 27, 24, 23, 36,
15 37, 31, 38, 36, 36, 36, 34, 38, 32, 38, 25, 38,
16 26, 22, 32, 36, 27, 27, 44, 32, 28, 31};
17
18 std::vector<std::string> origin = {
19 "USA", "USA", "USA", "USA", "USA", "USA", "USA",
20 "USA", "USA", "USA", "USA", "USA", "USA", "USA",
21 "Japan", "USA", "USA", "USA", "Japan", "Germany", "France",
22 "Germany", "Sweden", "Germany", "USA", "USA", "USA", "USA",
23 "USA", "Italy", "Germany", "USA", "USA", "France", "USA",
24 "USA", "USA", "USA", "USA", "USA", "USA", "USA",
25 "USA", "USA", "Germany", "Japan", "USA", "USA", "USA",
26 "USA", "Germany", "Japan", "Japan", "USA", "Sweden", "USA",
27 "France", "Japan", "Germany", "USA", "USA", "USA", "USA",
28 "USA", "USA", "USA", "USA", "USA", "USA", "USA",
29 "USA", "Germany", "Japan", "Japan", "USA", "USA", "Japan",
30 "Japan", "Japan", "Japan", "Japan", "Japan", "USA", "USA",
31 "USA", "USA", "Japan", "USA", "USA", "USA", "Germany",
32 "USA", "USA", "USA"};
33
34 boxplot(mpg, origin);
35 xlabel("All Vehicles");
36 ylabel("Miles per Gallon (MPG)");
37 title("Miles per Gallon for All Vehicles");
38
39 show();
40 return 0;
41}

Callers

nothing calls this directly

Calls 5

xlabelFunction · 0.85
ylabelFunction · 0.85
showFunction · 0.85
boxplotFunction · 0.50
titleFunction · 0.50

Tested by

no test coverage detected