Skip to content

Updated named plots to infer different datatypes in case of x and y inputs. #226

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions matplotlibcpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,9 @@ template <> struct select_npy_type<uint64_t> { const static NPY_TYPES type = NPY

// Sanity checks; comment them out or change the numpy type below if you're compiling on
// a platform where they don't apply
static_assert(sizeof(long long) == 8);
// static_assert(sizeof(long long) == 8);
template <> struct select_npy_type<long long> { const static NPY_TYPES type = NPY_INT64; };
static_assert(sizeof(unsigned long long) == 8);
// static_assert(sizeof(unsigned long long) == 8);
template <> struct select_npy_type<unsigned long long> { const static NPY_TYPES type = NPY_UINT64; };
// TODO: add int, long, etc.

Expand Down Expand Up @@ -1367,8 +1367,8 @@ bool named_plot(const std::string& name, const std::vector<Numeric>& y, const st
return res;
}

template<typename Numeric>
bool named_plot(const std::string& name, const std::vector<Numeric>& x, const std::vector<Numeric>& y, const std::string& format = "")
template<typename NumericX, typename NumericY>
bool named_plot(const std::string& name, const std::vector<NumericX>& x, const std::vector<NumericY>& y, const std::string& format = "")
{
detail::_interpreter::get();

Expand All @@ -1394,8 +1394,8 @@ bool named_plot(const std::string& name, const std::vector<Numeric>& x, const st
return res;
}

template<typename Numeric>
bool named_semilogx(const std::string& name, const std::vector<Numeric>& x, const std::vector<Numeric>& y, const std::string& format = "")
template<typename NumericX, typename NumericY>
bool named_semilogx(const std::string& name, const std::vector<NumericX>& x, const std::vector<NumericY>& y, const std::string& format = "")
{
detail::_interpreter::get();

Expand All @@ -1421,8 +1421,8 @@ bool named_semilogx(const std::string& name, const std::vector<Numeric>& x, cons
return res;
}

template<typename Numeric>
bool named_semilogy(const std::string& name, const std::vector<Numeric>& x, const std::vector<Numeric>& y, const std::string& format = "")
template<typename NumericX, typename NumericY>
bool named_semilogy(const std::string& name, const std::vector<NumericX>& x, const std::vector<NumericY>& y, const std::string& format = "")
{
detail::_interpreter::get();

Expand All @@ -1448,8 +1448,8 @@ bool named_semilogy(const std::string& name, const std::vector<Numeric>& x, cons
return res;
}

template<typename Numeric>
bool named_loglog(const std::string& name, const std::vector<Numeric>& x, const std::vector<Numeric>& y, const std::string& format = "")
template<typename NumericX, typename NumericY>
bool named_loglog(const std::string& name, const std::vector<NumericX>& x, const std::vector<NumericY>& y, const std::string& format = "")
{
detail::_interpreter::get();

Expand Down