Skip to content

Navigation Menu

Sign in
Appearance settings

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

Sign up
Appearance settings

metacall/embedding-matplotlib-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

8 Commits

Repository files navigation

MetaCall Embedding matplotlib Example

This example shows how to build and run Python matplotlib from C/C++ source code. The instructions are focused on Linux but it can be ported to other platforms easily.

Install

Install MetaCall:

git clone https://github.com/metacall/core.git
mkdir core/build && cd core/build
cmake -DOPTION_BUILD_LOADERS_PY=On -DOPTION_BUILD_DETOURS=Off -DOPTION_BUILD_SCRIPTS=Off -DOPTION_BUILD_TESTS=Off ..
cmake --build . --target install

Install matplotlib dependency:

pip3 install --user matplotlib

Build

Build example source code:

gcc -std=c11 main.c -lmetacall

Run

Run executable previously built:

export LOADER_SCRIPT_PATH="`pwd`"
./a.out

Docker

Building and running with Docker:

docker build -t metacall/embedding-matplotlib-example .
docker run --rm -v $(pwd)/output:/output -it metacall/embedding-matplotlib-example ./a.out

For seeing the plot, open the output folder.

About

An example of embedding matplotlib from Python into C/C++.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /