Skip to content

Commit 5038c33

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

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy