Skip to content

Commit 0a4f6c7

Browse files
committed
setup_axis_ticks: fix for optional parameters (cf #405)
1 parent 8f503df commit 0a4f6c7

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

external/implot/bindings/pybind_implot.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3709,7 +3709,13 @@ void implot_binding_manual(nb::module_& m)
37093709
}
37103710
ImPlot::SetupAxisTicks(axis, v_min, v_max, n_ticks, label_char.data(), keep_default);
37113711
}
3712-
}, nb::arg("axis"), nb::arg("v_min"), nb::arg("v_max"), nb::arg("n_ticks"), nb::arg("labels"), nb::arg("keep_default"),
3712+
},
3713+
nb::arg("axis"),
3714+
nb::arg("v_min"),
3715+
nb::arg("v_max"),
3716+
nb::arg("n_ticks"),
3717+
nb::arg("labels") = std::nullopt,
3718+
nb::arg("keep_default") = false,
37133719
"Sets an axis' ticks and optionally the labels for the next plot. To keep the default ticks, set #keep_default=true."
37143720
);
37153721
m.def("setup_axis_ticks",
@@ -3728,7 +3734,11 @@ void implot_binding_manual(nb::module_& m)
37283734
}
37293735
ImPlot::SetupAxisTicks(axis, values.data(), n_ticks, label_char.data(), keep_default);
37303736
}
3731-
}, nb::arg("axis"), nb::arg("values"), nb::arg("labels"), nb::arg("keep_default"),
3737+
},
3738+
nb::arg("axis"),
3739+
nb::arg("values"),
3740+
nb::arg("labels") = std::nullopt,
3741+
nb::arg("keep_default") = false,
37323742
"Sets an axis' ticks and optionally the labels for the next plot. To keep the default ticks, set #keep_default=true."
37333743
);
37343744

external/implot3d/bindings/pybind_implot3d.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,7 +1644,13 @@ void implot3d_binding_manual(nb::module_& m)
16441644
}
16451645
ImPlot3D::SetupAxisTicks(axis, v_min, v_max, n_ticks, label_char.data(), keep_default);
16461646
}
1647-
}, nb::arg("axis"), nb::arg("v_min"), nb::arg("v_max"), nb::arg("n_ticks"), nb::arg("labels"), nb::arg("keep_default"),
1647+
},
1648+
nb::arg("axis"),
1649+
nb::arg("v_min"),
1650+
nb::arg("v_max"),
1651+
nb::arg("n_ticks"),
1652+
nb::arg("labels") = std::nullopt,
1653+
nb::arg("keep_default") = false,
16481654
"Sets an axis' ticks and optionally the labels for the next plot. To keep the default ticks, set #keep_default=true."
16491655
);
16501656
m.def("setup_axis_ticks",
@@ -1663,7 +1669,11 @@ void implot3d_binding_manual(nb::module_& m)
16631669
}
16641670
ImPlot3D::SetupAxisTicks(axis, values.data(), n_ticks, label_char.data(), keep_default);
16651671
}
1666-
}, nb::arg("axis"), nb::arg("values"), nb::arg("labels"), nb::arg("keep_default"),
1672+
},
1673+
nb::arg("axis"),
1674+
nb::arg("values"),
1675+
nb::arg("labels") = std::nullopt,
1676+
nb::arg("keep_default") = false,
16671677
"Sets an axis' ticks and optionally the labels for the next plot. To keep the default ticks, set #keep_default=true."
16681678
);
16691679

0 commit comments

Comments
 (0)