Giter VIP home page Giter VIP logo

matplotlib-cpp's People

Contributors

adiba avatar alessandro-gentilini avatar alexdewar avatar amintahmasbi avatar atsushisakai avatar austinschuh avatar biphasic avatar chachay avatar charasyn avatar christost avatar cryoris avatar flyvbee avatar kartikmohta avatar kexianshen avatar lava avatar liuweijunantihos avatar mandarancio avatar mdmosley1 avatar okermorgant avatar paralax avatar patrikfors avatar pauljurczak avatar quangtung97 avatar raldridge11 avatar tomix1024 avatar torfinnberset avatar tustvold avatar valeriomagnago avatar williamrob104 avatar yuma-m avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

matplotlib-cpp's Issues

Calling functions that are obsolete.

If you use the latest version of Python 3.11, the library calls functions considered obsolete since that version. It is possible to force the compiler to ignore the warning, but this means that these functions may cease to exist at some point.

Undefined symbols for architecture arm64:....

Hello,

First, thanks for the great code. It is very helpful to have something nice to visualize the c++ results.

I have go through the code and it seems I am compiling it correctly. However, I am having the following error after the compilation:

"Undefined symbols for architecture arm64:
"_engClose", referenced from:
_main in MatlabPlot-8d1732.o
"_engEvalString", referenced from:
_main in MatlabPlot-8d1732.o
"_engGetVariable", referenced from:
_main in MatlabPlot-8d1732.o
"_engOpen", referenced from:
_main in MatlabPlot-8d1732.o
"_engOutputBuffer", referenced from:
_main in MatlabPlot-8d1732.o
"_engPutVariable", referenced from:
_main in MatlabPlot-8d1732.o
"_mxCreateDoubleMatrix_800", referenced from:
_main in MatlabPlot-8d1732.o
"_mxDestroyArray_800", referenced from:
_main in MatlabPlot-8d1732.o
"_mxGetClassName_800", referenced from:
_main in MatlabPlot-8d1732.o
"_mxGetPr_800", referenced from:
_main in MatlabPlot-8d1732.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)"

I wonder if there is a solution for this. I am running in an M1 MacBook Pro.

Thanks in advance.

Incorrect plot when arguments are blocks of an Eigen::Matrix

If I declare an

Eigen::Matrix _2D_data; /* The initialization does not matter. The first row holds the x-coordinates, and the second row holds the y-
coordinates. */

and I want to call

plt::plot(_2D_data.row(1), _2D_data.row(2));

the resulting plot will not be correct. Around 50% of the points will have their coordinates reversed (the x-coordinates will become y-coordinates and vice-versa).

To correctly plot, I have to write:

Eigen::VectorX x_coords{ _2D_data.row(0) };
Eigen::VectorX y_coords{ _2D_data.row(1) };

plt::plot(x_coords, y_coords);

Thanks for the otherwise great library!

ambiguous call

When compiling a standard example from readthedocs,

#include
#include "matplotlibcpp.h"
namespace plt = matplotlibcpp;
int main() {
std::vector x = {1, 2, 3, 4};
std::vector y = {1, 4, 9, 16};
plt::plot(x, y,"r*");
plt::show();
}

on VisualStudio22 with the ISO C++20 flag and native Python 3.10, I get

Screenshot 2022-01-26 172910

Apparently, the compiler cannot decide between

// @brief standard plot function supporting the args (x, y, s, keywords) // line 519
// ...
template <typename VectorX, typename VectorY>
bool plot(const VectorX &x, const VectorY &y, const std::string &s = "",
const std::map<std::string, std::string> &keywords = {}) {
return detail::plot_base(detail::_interpreter::get().s_python_function_plot,
x, y, s, keywords);
}

and

// enable plotting of multiple triples (x, y, format) // line 1953
template <typename A, typename B, typename... Args>
bool plot(const A &a, const B &b, const std::string &format, Args... args) {
return plot(a, b, format) && plot(args...);
}

As I understand, correct me if I'm wrong, there a several constructors, each of which is designed to fall through to the first one above, the one that finally calls plot_base. So, I renamed all constructors but the first one above plot1, and my code now successfully calls plt::plot1 ..... Of course, messing with your library and using non-standard calls on my side is not a proper solution. Rename the fall-through constructor, and I haven't even tested similarily overloaded functions?

plt::plot_surface(x, y, z);

my environment:
visual studio2022 use qt to draw image by matplotlibcpp, and i can draw all images in your https://github.com/Cryoris/matplotlib-cpp/readme.md except this one:

#include "../matplotlibcpp.h"

namespace plt = matplotlibcpp;

int main()
{
    std::vector<std::vector<double>> x, y, z;
    for (double i = -5; i <= 5;  i += 0.25) {
        std::vector<double> x_row, y_row, z_row;
        for (double j = -5; j <= 5; j += 0.25) {
            x_row.push_back(i);
            y_row.push_back(j);
            z_row.push_back(::std::sin(::std::hypot(i, j)));
        }
        x.push_back(x_row);
        y.push_back(y_row);
        z.push_back(z_row);
    }

    plt::plot_surface(x, y, z);
    plt::show();
}

the error is said there is a not processed error.
please answer me , thakns

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.