matplotlibcpp17
axes.h
1
5#pragma once
6
7#include <tuple>
8#include <vector>
9
10#include <matplotlibcpp17/collections.h>
11#include <matplotlibcpp17/common.h>
12#include <matplotlibcpp17/container.h>
13#include <matplotlibcpp17/legend.h>
14#include <matplotlibcpp17/quiver.h>
15#include <matplotlibcpp17/text.h>
16
17#include <pybind11/pybind11.h>
18
19namespace matplotlibcpp17::axes {
20
24using HistType = std::tuple<std::vector<double>, std::vector<double>,
25 container::BarContainer>;
26
30struct DECL_STRUCT_ATTR Axes : public BaseWrapper {
31public:
32 Axes(const pybind11::object &axes) {
33 self = axes;
34 load_attrs();
35 }
36 Axes(pybind11::object &&axes) {
37 self = std::move(axes);
38 load_attrs();
39 }
40
41 // add_artist
42 ObjectWrapper add_artist(const pybind11::tuple &args = pybind11::tuple(),
43 const pybind11::dict &kwargs = pybind11::dict());
44
45 // add_collection
46 ObjectWrapper add_collection(const pybind11::tuple &args = pybind11::tuple(),
47 const pybind11::dict &kwargs = pybind11::dict());
48
49 // add_patch
50 ObjectWrapper add_patch(const pybind11::tuple &args = pybind11::tuple(),
51 const pybind11::dict &kwargs = pybind11::dict());
52
53 // axhline
54 ObjectWrapper axhline(const pybind11::tuple &args = pybind11::tuple(),
55 const pybind11::dict &kwargs = pybind11::dict());
56 // axvline
57 ObjectWrapper axvline(const pybind11::tuple &args = pybind11::tuple(),
58 const pybind11::dict &kwargs = pybind11::dict());
59
60 // bar
61 container::BarContainer bar(const pybind11::tuple &args = pybind11::tuple(),
62 const pybind11::dict &kwargs = pybind11::dict());
63
64 // bar_label
65 ObjectWrapper bar_label(const pybind11::tuple &args = pybind11::tuple(),
66 const pybind11::dict &kwargs = pybind11::dict());
67
68 // barh
69 container::BarContainer barh(const pybind11::tuple &args = pybind11::tuple(),
70 const pybind11::dict &kwargs = pybind11::dict());
71
72 // cla
73 ObjectWrapper cla(const pybind11::tuple &args = pybind11::tuple(),
74 const pybind11::dict &kwargs = pybind11::dict());
75
76 // contour
77 ObjectWrapper contour(const pybind11::tuple &args = pybind11::tuple(),
78 const pybind11::dict &kwargs = pybind11::dict());
79
80 // contourf
81 ObjectWrapper contourf(const pybind11::tuple &args = pybind11::tuple(),
82 const pybind11::dict &kwargs = pybind11::dict());
83
84 // errorbar
85 ObjectWrapper errorbar(const pybind11::tuple &args = pybind11::tuple(),
86 const pybind11::dict &kwargs = pybind11::dict());
87
88 // fill
89 ObjectWrapper fill(const pybind11::tuple &args = pybind11::tuple(),
90 const pybind11::dict &kwargs = pybind11::dict());
91
92 // fill_between
93 ObjectWrapper fill_between(const pybind11::tuple &args = pybind11::tuple(),
94 const pybind11::dict &kwargs = pybind11::dict());
95
96 // fill_betweenx
97 ObjectWrapper fill_betweenx(const pybind11::tuple &args = pybind11::tuple(),
98 const pybind11::dict &kwargs = pybind11::dict());
99
100 // get_lines
101 ObjectWrapper get_lines(const pybind11::tuple &args = pybind11::tuple(),
102 const pybind11::dict &kwargs = pybind11::dict());
103
104 // get_xaxis_transform
106 get_xaxis_transform(const pybind11::tuple &args = pybind11::tuple(),
107 const pybind11::dict &kwargs = pybind11::dict());
108
109 // get_xlim
110 std::tuple<double, double> get_xlim();
111
112 // get_xticklabels
113 std::vector<text::Text> get_xticklabels();
114
115 // grid
116 ObjectWrapper grid(const pybind11::tuple &args = pybind11::tuple(),
117 const pybind11::dict &kwargs = pybind11::dict());
118
119 // hist
120 HistType hist(const pybind11::tuple &args = pybind11::tuple(),
121 const pybind11::dict &kwargs = pybind11::dict());
122
123 // hist2d
124 ObjectWrapper hist2d(const pybind11::tuple &args = pybind11::tuple(),
125 const pybind11::dict &kwargs = pybind11::dict());
126
127 // imshow
128 ObjectWrapper imshow(const pybind11::tuple &args = pybind11::tuple(),
129 const pybind11::dict &kwargs = pybind11::dict());
130
131 // invert_yaxis
132 ObjectWrapper invert_yaxis(const pybind11::tuple &args = pybind11::tuple(),
133 const pybind11::dict &kwargs = pybind11::dict());
134
135 // legend
136 legend::Legend legend(const pybind11::tuple &args = pybind11::tuple(),
137 const pybind11::dict &kwargs = pybind11::dict());
138
139 // pcolormesh
141 pcolormesh(const pybind11::tuple &args = pybind11::tuple(),
142 const pybind11::dict &kwargs = pybind11::dict());
143
144 // plot
145 ObjectWrapper plot(const pybind11::tuple &args = pybind11::tuple(),
146 const pybind11::dict &kwargs = pybind11::dict());
147
148 // plot_surface
149 ObjectWrapper plot_surface(const pybind11::tuple &args = pybind11::tuple(),
150 const pybind11::dict &kwargs = pybind11::dict());
151
152 // plot_wireframe
153 ObjectWrapper plot_wireframe(const pybind11::tuple &args = pybind11::tuple(),
154 const pybind11::dict &kwargs = pybind11::dict());
155
156 // quiver
157 quiver::Quiver quiver(const pybind11::tuple &args = pybind11::tuple(),
158 const pybind11::dict &kwargs = pybind11::dict());
159
160 // quiverkey
161 quiver::QuiverKey quiverkey(const pybind11::tuple &args = pybind11::tuple(),
162 const pybind11::dict &kwargs = pybind11::dict());
163
164 // scatter
166 scatter(const pybind11::tuple &args = pybind11::tuple(),
167 const pybind11::dict &kwargs = pybind11::dict());
168
169 // set
170 ObjectWrapper set(const pybind11::tuple &args = pybind11::tuple(),
171 const pybind11::dict &kwargs = pybind11::dict());
172
173 // set_adjustable
174 ObjectWrapper set_adjustable(const pybind11::tuple &args = pybind11::tuple(),
175 const pybind11::dict &kwargs = pybind11::dict());
176
177 // set_aspect
178 ObjectWrapper set_aspect(const pybind11::tuple &args = pybind11::tuple(),
179 const pybind11::dict &kwargs = pybind11::dict());
180
181 // set_title
182 ObjectWrapper set_title(const pybind11::tuple &args = pybind11::tuple(),
183 const pybind11::dict &kwargs = pybind11::dict());
184
185 // set_xlabel
186 ObjectWrapper set_xlabel(const pybind11::tuple &args = pybind11::tuple(),
187 const pybind11::dict &kwargs = pybind11::dict());
188
189 // set_xlim
190 ObjectWrapper set_xlim(const pybind11::tuple &args = pybind11::tuple(),
191 const pybind11::dict &kwargs = pybind11::dict());
192
193 // set_xscale
194 ObjectWrapper set_xscale(const pybind11::tuple &args = pybind11::tuple(),
195 const pybind11::dict &kwargs = pybind11::dict());
196
197 // set_xticks
198 ObjectWrapper set_xticks(const pybind11::tuple &args = pybind11::tuple(),
199 const pybind11::dict &kwargs = pybind11::dict());
200
201 // set_xticklabels
203 set_xticklabels(const pybind11::tuple &args = pybind11::tuple(),
204 const pybind11::dict &kwargs = pybind11::dict());
205
206 // set_ylabel
207 ObjectWrapper set_ylabel(const pybind11::tuple &args = pybind11::tuple(),
208 const pybind11::dict &kwargs = pybind11::dict());
209
210 // set_ylim
211 ObjectWrapper set_ylim(const pybind11::tuple &args = pybind11::tuple(),
212 const pybind11::dict &kwargs = pybind11::dict());
213
214 // set_yscale
215 ObjectWrapper set_yscale(const pybind11::tuple &args = pybind11::tuple(),
216 const pybind11::dict &kwargs = pybind11::dict());
217
218 // set_yticks
219 ObjectWrapper set_yticks(const pybind11::tuple &args = pybind11::tuple(),
220 const pybind11::dict &kwargs = pybind11::dict());
221
222 // set_zlabel
223 ObjectWrapper set_zlabel(const pybind11::tuple &args = pybind11::tuple(),
224 const pybind11::dict &kwargs = pybind11::dict());
225
226 // set_zlim
227 ObjectWrapper set_zlim(const pybind11::tuple &args = pybind11::tuple(),
228 const pybind11::dict &kwargs = pybind11::dict());
229
230 // text
231 ObjectWrapper text(const pybind11::tuple &args = pybind11::tuple(),
232 const pybind11::dict &kwargs = pybind11::dict());
233
234 // tick_params
235 ObjectWrapper tick_params(const pybind11::tuple &args = pybind11::tuple(),
236 const pybind11::dict &kwargs = pybind11::dict());
237
238 // twinx
239 Axes twinx(const pybind11::tuple &args = pybind11::tuple(),
240 const pybind11::dict &kwargs = pybind11::dict());
241
242private:
243 void load_attrs() {
244 // NOTE: only when called with projection='3d', `plot_surface`,
245 // `plot_wireframe`, `set_zlabel` prop exists.
246 try {
247 LOAD_FUNC_ATTR(plot_surface, self);
248 LOAD_FUNC_ATTR(plot_wireframe, self);
249 LOAD_FUNC_ATTR(set_zlabel, self);
250 LOAD_FUNC_ATTR(set_zlim, self);
251 INFO_MSG("Loaded Axes3D");
252 projection_3d = true;
253 } catch (...) {
254 projection_3d = false;
255 }
256 LOAD_FUNC_ATTR(add_artist, self);
257 LOAD_FUNC_ATTR(add_collection, self);
258 LOAD_FUNC_ATTR(add_patch, self);
259 LOAD_FUNC_ATTR(axhline, self);
260 LOAD_FUNC_ATTR(axvline, self);
261 LOAD_FUNC_ATTR(bar, self);
262#if MATPLOTLIB_MINOR_VER_GTE_4
263 LOAD_FUNC_ATTR(bar_label, self);
264#else
265 WARN_MSG("Not loading bar_label because matplotlib version is < 3.4.0");
266#endif
267 LOAD_FUNC_ATTR(barh, self);
268 LOAD_FUNC_ATTR(cla, self);
269 LOAD_FUNC_ATTR(contour, self);
270 LOAD_FUNC_ATTR(contourf, self);
271 LOAD_FUNC_ATTR(errorbar, self);
272 LOAD_FUNC_ATTR(fill, self);
273 LOAD_FUNC_ATTR(fill_between, self);
274 LOAD_FUNC_ATTR(fill_betweenx, self);
275 LOAD_FUNC_ATTR(get_lines, self);
276 LOAD_FUNC_ATTR(get_xaxis_transform, self);
277 LOAD_FUNC_ATTR(get_xlim, self);
278 LOAD_FUNC_ATTR(get_xticklabels, self);
279 LOAD_FUNC_ATTR(grid, self);
280 LOAD_FUNC_ATTR(hist, self);
281 LOAD_FUNC_ATTR(hist2d, self);
282 LOAD_FUNC_ATTR(invert_yaxis, self);
283 LOAD_FUNC_ATTR(imshow, self);
284 LOAD_FUNC_ATTR(legend, self);
285 LOAD_FUNC_ATTR(pcolormesh, self);
286 LOAD_FUNC_ATTR(plot, self);
287 LOAD_FUNC_ATTR(quiver, self);
288 LOAD_FUNC_ATTR(quiverkey, self);
289 LOAD_FUNC_ATTR(scatter, self);
290 LOAD_FUNC_ATTR(set, self);
291 LOAD_FUNC_ATTR(set_adjustable, self);
292 LOAD_FUNC_ATTR(set_aspect, self);
293 LOAD_FUNC_ATTR(set_title, self);
294 LOAD_FUNC_ATTR(set_xlabel, self);
295 LOAD_FUNC_ATTR(set_xlim, self);
296 LOAD_FUNC_ATTR(set_xscale, self);
297 LOAD_FUNC_ATTR(set_xticks, self);
298 LOAD_FUNC_ATTR(set_xticklabels, self);
299 LOAD_FUNC_ATTR(set_ylabel, self);
300 LOAD_FUNC_ATTR(set_ylim, self);
301 LOAD_FUNC_ATTR(set_yscale, self);
302 LOAD_FUNC_ATTR(set_yticks, self);
303 LOAD_FUNC_ATTR(text, self);
304 LOAD_FUNC_ATTR(tick_params, self);
305 LOAD_FUNC_ATTR(twinx, self);
306 }
307 pybind11::object add_artist_attr;
308 pybind11::object add_collection_attr;
309 pybind11::object add_patch_attr;
310 pybind11::object axhline_attr;
311 pybind11::object axvline_attr;
312 pybind11::object bar_attr;
313 pybind11::object bar_label_attr;
314 pybind11::object barh_attr;
315 pybind11::object cla_attr;
316 pybind11::object contour_attr;
317 pybind11::object contourf_attr;
318 pybind11::object errorbar_attr;
319 pybind11::object fill_attr;
320 pybind11::object fill_between_attr;
321 pybind11::object fill_betweenx_attr;
322 pybind11::object get_lines_attr;
323 pybind11::object get_xaxis_transform_attr;
324 pybind11::object get_xlim_attr;
325 pybind11::object get_xticklabels_attr;
326 pybind11::object grid_attr;
327 pybind11::object hist_attr;
328 pybind11::object hist2d_attr;
329 pybind11::object invert_yaxis_attr;
330 pybind11::object imshow_attr;
331 pybind11::object legend_attr;
332 pybind11::object pcolormesh_attr;
333 pybind11::object plot_attr;
334 pybind11::object plot_surface_attr;
335 pybind11::object plot_wireframe_attr;
336 pybind11::object quiver_attr;
337 pybind11::object quiverkey_attr;
338 pybind11::object scatter_attr;
339 pybind11::object set_attr;
340 pybind11::object set_adjustable_attr;
341 pybind11::object set_aspect_attr;
342 pybind11::object set_title_attr;
343 pybind11::object set_xlabel_attr;
344 pybind11::object set_xlim_attr;
345 pybind11::object set_xscale_attr;
346 pybind11::object set_xticks_attr;
347 pybind11::object set_xticklabels_attr;
348 pybind11::object set_ylabel_attr;
349 pybind11::object set_ylim_attr;
350 pybind11::object set_yscale_attr;
351 pybind11::object set_yticks_attr;
352 pybind11::object set_zlabel_attr;
353 pybind11::object set_zlim_attr;
354 pybind11::object text_attr;
355 pybind11::object tick_params_attr;
356 pybind11::object twinx_attr;
357 // 3d
358 bool projection_3d;
359};
360
361// add_artist
362inline ObjectWrapper Axes::add_artist(const pybind11::tuple &args,
363 const pybind11::dict &kwargs) {
364 pybind11::object ret = add_artist_attr(*args, **kwargs);
365 return ObjectWrapper(std::move(ret));
366}
367
368// add_collection
369inline ObjectWrapper Axes::add_collection(const pybind11::tuple &args,
370 const pybind11::dict &kwargs) {
371 pybind11::object ret = add_collection_attr(*args, **kwargs);
372 return ObjectWrapper(std::move(ret));
373}
374
375// add_patch
376inline ObjectWrapper Axes::add_patch(const pybind11::tuple &args,
377 const pybind11::dict &kwargs) {
378 pybind11::object ret = add_patch_attr(*args, **kwargs);
379 return ObjectWrapper(std::move(ret));
380}
381
382// axhline
383inline ObjectWrapper Axes::axhline(const pybind11::tuple &args,
384 const pybind11::dict &kwargs) {
385 pybind11::object ret = axhline_attr(*args, **kwargs);
386 return ObjectWrapper(std::move(ret));
387}
388
389// axvline
390inline ObjectWrapper Axes::axvline(const pybind11::tuple &args,
391 const pybind11::dict &kwargs) {
392 pybind11::object ret = axvline_attr(*args, **kwargs);
393 return ObjectWrapper(std::move(ret));
394}
395
396// bar
397inline container::BarContainer Axes::bar(const pybind11::tuple &args,
398 const pybind11::dict &kwargs) {
399 pybind11::object obj = bar_attr(*args, **kwargs);
400 return container::BarContainer(obj);
401}
402
403// bar_label
404inline ObjectWrapper Axes::bar_label(const pybind11::tuple &args,
405 const pybind11::dict &kwargs) {
406#if MATPLOTLIB_MINOR_VER_GTE_4
407 pybind11::object ret = bar_label_attr(*args, **kwargs);
408 return ObjectWrapper(std::move(ret));
409#else
410 ERROR_MSG(
411 "Call to bar_label is invalid because matplotlib version is < 3.4.0");
412 std::exit(0);
413#endif
414}
415
416// barh
417inline container::BarContainer Axes::barh(const pybind11::tuple &args,
418 const pybind11::dict &kwargs) {
419 pybind11::object obj = barh_attr(*args, **kwargs);
420 return container::BarContainer(obj);
421}
422
423// cla
424inline ObjectWrapper Axes::cla(const pybind11::tuple &args,
425 const pybind11::dict &kwargs) {
426 pybind11::object ret = cla_attr(*args, **kwargs);
427 return ObjectWrapper(std::move(ret));
428}
429
430// contour
431inline ObjectWrapper Axes::contour(const pybind11::tuple &args,
432 const pybind11::dict &kwargs) {
433 pybind11::object ret = contour_attr(*args, **kwargs);
434 return ObjectWrapper(std::move(ret));
435}
436
437// contourf
438inline ObjectWrapper Axes::contourf(const pybind11::tuple &args,
439 const pybind11::dict &kwargs) {
440 pybind11::object ret = contourf_attr(*args, **kwargs);
441 return ObjectWrapper(std::move(ret));
442}
443
444// errorbar
445inline ObjectWrapper Axes::errorbar(const pybind11::tuple &args,
446 const pybind11::dict &kwargs) {
447 if (projection_3d) {
448#if MATPLOTLIB_MINOR_VER_GTE_4
449 pybind11::object obj = errorbar_attr(*args, **kwargs);
450 return obj;
451#else
452 ERROR_MSG("Call to errorbar with projection='3d' is invalid because "
453 "matplotlib version is < 3.4.0");
454 std::exit(0);
455#endif
456 } else {
457 pybind11::object ret = errorbar_attr(*args, **kwargs);
458 return ObjectWrapper(std::move(ret));
459 }
460}
461
462// fill
463inline ObjectWrapper Axes::fill(const pybind11::tuple &args,
464 const pybind11::dict &kwargs) {
465 pybind11::object ret = fill_attr(*args, **kwargs);
466 return ObjectWrapper(std::move(ret));
467}
468
469// fill_between
470inline ObjectWrapper Axes::fill_between(const pybind11::tuple &args,
471 const pybind11::dict &kwargs) {
472 pybind11::object ret = fill_between_attr(*args, **kwargs);
473 return ObjectWrapper(std::move(ret));
474}
475
476// fill_betweenx
477inline ObjectWrapper Axes::fill_betweenx(const pybind11::tuple &args,
478 const pybind11::dict &kwargs) {
479 pybind11::object ret = fill_betweenx_attr(*args, **kwargs);
480 return ObjectWrapper(std::move(ret));
481}
482
483// get_lines
484inline ObjectWrapper Axes::get_lines(const pybind11::tuple &args,
485 const pybind11::dict &kwargs) {
486 pybind11::object ret = get_lines_attr(*args, **kwargs);
487 return ObjectWrapper(std::move(ret));
488}
489
490// get_xaxis_transform
491inline ObjectWrapper Axes::get_xaxis_transform(const pybind11::tuple &args,
492 const pybind11::dict &kwargs) {
493 pybind11::object ret = get_xaxis_transform_attr(*args, **kwargs);
494 return ObjectWrapper(std::move(ret));
495}
496
497// get_xlim
498inline std::tuple<double, double> Axes::get_xlim() {
499 pybind11::list ret = get_xlim_attr();
500 double x1 = ret[0].cast<double>();
501 double x2 = ret[1].cast<double>();
502 return {x1, x2};
503}
504
505// get_xticklabels
506inline std::vector<text::Text> Axes::get_xticklabels() {
507 pybind11::list ret = get_xticklabels_attr();
508 std::vector<text::Text> texts;
509 for (pybind11::size_t i = 0; i < ret.size(); ++i) {
510 texts.push_back(text::Text(ret[i]));
511 }
512 return texts;
513}
514
515// grid
516inline ObjectWrapper Axes::grid(const pybind11::tuple &args,
517 const pybind11::dict &kwargs) {
518 pybind11::object ret = grid_attr(*args, **kwargs);
519 return ObjectWrapper(std::move(ret));
520}
521
522// hist
523inline std::tuple<std::vector<double>, std::vector<double>,
524 container::BarContainer>
525Axes::hist(const pybind11::tuple &args, const pybind11::dict &kwargs) {
526 pybind11::list ret = hist_attr(*args, **kwargs);
527 // parse N, bins, patches
528 pybind11::list N_obj = ret[0], bins_obj = ret[1];
529 pybind11::object patches_obj = ret[2];
530 std::vector<double> N, bins;
531 for (auto it = N_obj.begin(); it != N_obj.end(); it++) {
532 N.push_back(it->cast<double>());
533 }
534 for (auto it = bins_obj.begin(); it != bins_obj.end(); it++) {
535 bins.push_back(it->cast<double>());
536 }
537 return {N, bins, container::BarContainer(patches_obj)};
538}
539
540// hist2d
541inline ObjectWrapper Axes::hist2d(const pybind11::tuple &args,
542 const pybind11::dict &kwargs) {
543 pybind11::object ret = hist2d_attr(*args, **kwargs);
544 return ObjectWrapper(std::move(ret));
545}
546
547// invert_yaxis
548inline ObjectWrapper Axes::invert_yaxis(const pybind11::tuple &args,
549 const pybind11::dict &kwargs) {
550 pybind11::object ret = invert_yaxis_attr(*args, **kwargs);
551 return ObjectWrapper(std::move(ret));
552}
553
554// imshow
555inline ObjectWrapper Axes::imshow(const pybind11::tuple &args,
556 const pybind11::dict &kwargs) {
557 pybind11::object ret = imshow_attr(*args, **kwargs);
558 return ObjectWrapper(std::move(ret));
559}
560
561// legend
562inline legend::Legend Axes::legend(const pybind11::tuple &args,
563 const pybind11::dict &kwargs) {
564 pybind11::object obj = legend_attr(*args, **kwargs);
565 return legend::Legend(obj);
566}
567
568// pcolormesh
569inline collections::QuadMesh Axes::pcolormesh(const pybind11::tuple &args,
570 const pybind11::dict &kwargs) {
571 pybind11::object ret = pcolormesh_attr(*args, **kwargs);
572 return collections::QuadMesh(ret);
573}
574
575// plot
576inline ObjectWrapper Axes::plot(const pybind11::tuple &args,
577 const pybind11::dict &kwargs) {
578 pybind11::object ret = plot_attr(*args, **kwargs);
579 return ObjectWrapper(std::move(ret));
580}
581
582// plot_surface
583inline ObjectWrapper Axes::plot_surface(const pybind11::tuple &args,
584 const pybind11::dict &kwargs) {
585 pybind11::object ret = plot_surface_attr(*args, **kwargs);
586 return ObjectWrapper(std::move(ret));
587}
588
589// plot_wireframe
590inline ObjectWrapper Axes::plot_wireframe(const pybind11::tuple &args,
591 const pybind11::dict &kwargs) {
592 pybind11::object ret = plot_wireframe_attr(*args, **kwargs);
593 return ObjectWrapper(std::move(ret));
594}
595
596// quiver
597inline quiver::Quiver Axes::quiver(const pybind11::tuple &args,
598 const pybind11::dict &kwargs) {
599 pybind11::object obj = quiver_attr(*args, **kwargs);
600 return quiver::Quiver(obj);
601}
602
603// quiverkey
604inline quiver::QuiverKey Axes::quiverkey(const pybind11::tuple &args,
605 const pybind11::dict &kwargs) {
606 pybind11::object obj = quiverkey_attr(*args, **kwargs);
607 return quiver::QuiverKey(obj);
608}
609
610// scatter
611inline collections::PathCollection Axes::scatter(const pybind11::tuple &args,
612 const pybind11::dict &kwargs) {
613 pybind11::object obj = scatter_attr(*args, **kwargs);
614 return collections::PathCollection(obj);
615}
616
617// set
618inline ObjectWrapper Axes::set(const pybind11::tuple &args,
619 const pybind11::dict &kwargs) {
620 pybind11::object ret = set_attr(*args, **kwargs);
621 return ObjectWrapper(std::move(ret));
622}
623
624// set_adjustable
625inline ObjectWrapper Axes::set_adjustable(const pybind11::tuple &args,
626 const pybind11::dict &kwargs) {
627 pybind11::object ret = set_adjustable_attr(*args, **kwargs);
628 return ObjectWrapper(std::move(ret));
629}
630
631// set_aspect
632inline ObjectWrapper Axes::set_aspect(const pybind11::tuple &args,
633 const pybind11::dict &kwargs) {
634 pybind11::object ret = set_aspect_attr(*args, **kwargs);
635 return ObjectWrapper(std::move(ret));
636}
637
638// set_title
639inline ObjectWrapper Axes::set_title(const pybind11::tuple &args,
640 const pybind11::dict &kwargs) {
641 pybind11::object ret = set_title_attr(*args, **kwargs);
642 return ObjectWrapper(std::move(ret));
643}
644
645// set_xlabel
646inline ObjectWrapper Axes::set_xlabel(const pybind11::tuple &args,
647 const pybind11::dict &kwargs) {
648 pybind11::object ret = set_xlabel_attr(*args, **kwargs);
649 return ObjectWrapper(std::move(ret));
650}
651
652// set_xlim
653inline ObjectWrapper Axes::set_xlim(const pybind11::tuple &args,
654 const pybind11::dict &kwargs) {
655 pybind11::object ret = set_xlim_attr(*args, **kwargs);
656 return ObjectWrapper(std::move(ret));
657}
658
659// set_xscale
660inline ObjectWrapper Axes::set_xscale(const pybind11::tuple &args,
661 const pybind11::dict &kwargs) {
662 pybind11::object ret = set_xscale_attr(*args, **kwargs);
663 return ObjectWrapper(std::move(ret));
664}
665
666// set_xticks
667inline ObjectWrapper Axes::set_xticks(const pybind11::tuple &args,
668 const pybind11::dict &kwargs) {
669 pybind11::object ret = set_xticks_attr(*args, **kwargs);
670 return ObjectWrapper(std::move(ret));
671}
672
673// set_xticklabels
674inline ObjectWrapper Axes::set_xticklabels(const pybind11::tuple &args,
675 const pybind11::dict &kwargs) {
676 pybind11::object ret = set_xticklabels_attr(*args, **kwargs);
677 return ObjectWrapper(std::move(ret));
678}
679
680// set_ylabel
681inline ObjectWrapper Axes::set_ylabel(const pybind11::tuple &args,
682 const pybind11::dict &kwargs) {
683 pybind11::object ret = set_ylabel_attr(*args, **kwargs);
684 return ObjectWrapper(std::move(ret));
685}
686
687// set_ylim
688inline ObjectWrapper Axes::set_ylim(const pybind11::tuple &args,
689 const pybind11::dict &kwargs) {
690 pybind11::object ret = set_ylim_attr(*args, **kwargs);
691 return ObjectWrapper(std::move(ret));
692}
693
694// set_yscale
695inline ObjectWrapper Axes::set_yscale(const pybind11::tuple &args,
696 const pybind11::dict &kwargs) {
697 pybind11::object ret = set_yscale_attr(*args, **kwargs);
698 return ObjectWrapper(std::move(ret));
699}
700
701// set_yticks
702inline ObjectWrapper Axes::set_yticks(const pybind11::tuple &args,
703 const pybind11::dict &kwargs) {
704 pybind11::object ret = set_yticks_attr(*args, **kwargs);
705 return ObjectWrapper(std::move(ret));
706}
707
708// set_zlabel
709inline ObjectWrapper Axes::set_zlabel(const pybind11::tuple &args,
710 const pybind11::dict &kwargs) {
711 pybind11::object ret = set_zlabel_attr(*args, **kwargs);
712 return ObjectWrapper(std::move(ret));
713}
714
715// set_zlim
716inline ObjectWrapper Axes::set_zlim(const pybind11::tuple &args,
717 const pybind11::dict &kwargs) {
718 pybind11::object ret = set_zlim_attr(*args, **kwargs);
719 return ObjectWrapper(std::move(ret));
720}
721
722// text
723inline ObjectWrapper Axes::text(const pybind11::tuple &args,
724 const pybind11::dict &kwargs) {
725 pybind11::object ret = text_attr(*args, **kwargs);
726 return ObjectWrapper(std::move(ret));
727}
728
729// tick_params
730inline ObjectWrapper Axes::tick_params(const pybind11::tuple &args,
731 const pybind11::dict &kwargs) {
732 pybind11::object ret = tick_params_attr(*args, **kwargs);
733 return ObjectWrapper(std::move(ret));
734}
735
736// twinx
737inline Axes Axes::twinx(const pybind11::tuple &args,
738 const pybind11::dict &kwargs) {
739 pybind11::object ret = twinx_attr(*args, **kwargs);
740 return Axes(ret);
741}
742
743} // namespace matplotlibcpp17::axes
A base class for python wrapper classes.
Definition: common.h:39
A proxy class for pybind object.
Definition: common.h:50
A wrapper class for matplotlib.axes.Axes.
Definition: axes.h:30
A wrapper class for matplotlib.collections.PathCollection.
Definition: collections.h:18
A wrapper class for matplotlib.collections.QuadMesh.
Definition: collections.h:82
A wrapper class for matplotlib.container.BarContainer.
Definition: container.h:16
A wrapper class for matplotlib.legend.Legend.
Definition: legend.h:16
A wrapper class for matplotlib.quiver.Quiver.
Definition: quiver.h:16
A wrapper class for matplotlib.quiver.QuiverKey.
Definition: quiver.h:25