matplotlib-cpp icon indicating copy to clipboard operation
matplotlib-cpp copied to clipboard

Use matplotlib-cpp with Windows Visual Code ?

Open Bourbaphy1989 opened this issue 4 years ago • 3 comments

Hello everybody. I use Windows Visual Code and I would like to draw curves on c ++ with matplotlib. The problem is that matplotlib-cpp only works with Visual Studio 2017. Is it possible to draw curves from c ++ using matplotlib in Visual Code? Thank you for your help.

Bourbaphy1989 avatar Jun 20 '20 16:06 Bourbaphy1989

Yes, I've had no problem using VSCode with this library. I dont think it's dependent on the editor, but on the compiler and flags. I use g++ to link python.

evelez7 avatar Jun 23 '20 21:06 evelez7

You need to add follwoings to work on windows with Visual C++ compiler

  • Add #include <string>
  • Add WITHOUT_NUMPY option or Remove lines 314 to 320 at the latest commit 7d0e695409e7029fd52a4653907a167b4cc725b9

With above workaround, matplotlib-cpp can work with any of 2015, 2017 and 2019.

I haven't tried, but vcpkg can be another option.

Chachay avatar Jun 24 '20 13:06 Chachay

Yes, I've had no problem using VSCode with this library. I dont think it's dependent on the editor, but on the compiler and flags. I use g++ to link python.

Hi,

How do you run the code using g++ in vs code terminal?

Ujjwalkanth avatar Oct 09 '20 14:10 Ujjwalkanth