15
15
#include " autoware/trajectory/point.hpp"
16
16
#include " autoware/trajectory/utils/shift.hpp"
17
17
18
- #include < matplotlibcpp17/pyplot.h>
18
+ #include < autoware/pyplot/pyplot.hpp>
19
+
20
+ #include < pybind11/embed.h>
21
+ #include < pybind11/stl.h>
19
22
20
23
#include < iostream>
21
24
#include < vector>
@@ -31,7 +34,7 @@ geometry_msgs::msg::Point point(double x, double y)
31
34
int main ()
32
35
{
33
36
pybind11::scoped_interpreter guard{};
34
- auto plt = matplotlibcpp17 ::pyplot::import ();
37
+ auto plt = autoware ::pyplot::import ();
35
38
36
39
std::vector<geometry_msgs::msg::Point > points = {
37
40
point (0.49 , 0.59 ), point (0.61 , 1.22 ), point (0.86 , 1.93 ), point (1.20 , 2.56 ), point (1.51 , 3.17 ),
@@ -74,8 +77,9 @@ int main()
74
77
y.push_back (p.y );
75
78
}
76
79
77
- plt.axis (Args (" equal" ));
78
80
plt.plot (Args (x, y), Kwargs (" label" _a = " shifted" ));
81
+ plt.axis (Args (" equal" ));
82
+ plt.grid ();
79
83
plt.legend ();
80
84
plt.show ();
81
85
}
@@ -105,8 +109,9 @@ int main()
105
109
y.push_back (p.y );
106
110
}
107
111
108
- plt.axis (Args (" equal" ));
109
112
plt.plot (Args (x, y), Kwargs (" label" _a = " shifted" ));
113
+ plt.axis (Args (" equal" ));
114
+ plt.grid ();
110
115
plt.legend ();
111
116
plt.show ();
112
117
}
@@ -136,8 +141,9 @@ int main()
136
141
y.push_back (p.y );
137
142
}
138
143
139
- plt.axis (Args (" equal" ));
140
144
plt.plot (Args (x, y), Kwargs (" label" _a = " shifted" ));
145
+ plt.axis (Args (" equal" ));
146
+ plt.grid ();
141
147
plt.legend ();
142
148
plt.show ();
143
149
}
@@ -174,8 +180,9 @@ int main()
174
180
y.push_back (p.y );
175
181
}
176
182
177
- plt.axis (Args (" equal" ));
178
183
plt.plot (Args (x, y), Kwargs (" label" _a = " shifted" ));
184
+ plt.axis (Args (" equal" ));
185
+ plt.grid ();
179
186
plt.legend ();
180
187
plt.show ();
181
188
}
0 commit comments