8000 convert hist and scatter to Vector · LTsommer/matplotlib-cpp@5038c33 · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5038c33

Browse files
committed
convert hist and scatter to Vector
1 parent 1fc25d9 commit 5038
10000
c33

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

matplotlibcpp.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -823,10 +823,9 @@ bool fill_between(const std::vector<Numeric> &x, const std::vector<Numeric> &y1,
823823
return res;
824824
}
825825

826-
template <typename Numeric>
827-
bool hist(const std::vector<Numeric> &y, long bins = 10,
828-
std::string color = "b", double alpha = 1.0,
829-
bool cumulative = false) {
826+
template <typename VectorY>
827+
bool hist(const VectorY &y, long bins = 10, std::string color = "b",
828+
double alpha = 1.0, bool cumulative = false) {
830829

831830
PyObject *yarray = get_array(y);
832831

@@ -851,10 +850,12 @@ bool hist(const std::vector<Numeric> &y, long bins = 10,
851850
return res;
852851
}
853852

854-
template <typename NumericX, typename NumericY>
855-
bool scatter(const std::vector<NumericX> &x, const std::vector<NumericY> &y,
856-
const double s = 1.0) // The marker size in points**2
857-
{
853+
// @brief Scatter plot
854+
// @param x x-coordinates of the 2d points
855+
// @param y y-coordinates of the 2d points
856+
// @param s the marker size in points**2
857+
template <typename VectorX, typename VectorY>
858+
bool scatter(const VectorX &x, const VectorY &y, const double s = 1.0) {
858859
assert(x.size() == y.size());
859860

860861
PyObject *xarray = get_array(x);

0 commit comments

Comments
 (0)
0