8000 Add cross-reference to wrappy · xuzhenqi/matplotlib-cpp@0fba0d4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0fba0d4

Browse files
committed
Add cross-reference to wrappy
1 parent d57f583 commit 0fba0d4

File tree

1 file changed

+23
-15
lines changed

1 file changed

+23
-15
lines changed

README.md

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,6 @@ matplotlib-cpp doesn't require C++11, but will enable some additional syntactic
9191

9292
Result: ![Modern example](./examples/modern.png)
9393

94-
Why?
95-
----
96-
I initially started this library during my diploma thesis. My previous approach of
97-
writing data from my c++ algorithm to a yaml file and afterwards parsing and plotting
98-
it in python using matplotlib proved insufficient: Keeping the algorithm
99-
and plotting code in sync requires a lot of effort when the C++ code frequently and substantially
100-
changes. Additionally, the python yaml parser is not able to cope with files that
101-
exceed a few hundred megabytes in size.
102-
103-
Therefore, I was looking for a C++ plotting library that was extremely to use
104-
and easy to add into an existing codebase, preferrably header-only. When I found
105-
none, I decided to create this library, which is basically a C++ wrapper around
106-
matplotlib. As you can see from the above examples, plotting data and saving it
107-
to an image file can be done is as few as two lines of code.
108-
10994
Installation
11095
------------
11196
matplotlib-cpp works by wrapping the popular python plotting library matplotlib. (matplotlib.org)
@@ -120,9 +105,32 @@ Since a python interpreter is opened internally, it is necessary to link against
120105
matplotlib-cpp.
121106
(There should be no problems using python3 instead of python2.7, if desired)
122107

108+
Why?
109+
----
110+
I initially started this library during my diploma thesis. The usual approach of
111+
writing data from the c++ algorithm to a file and afterwards parsing and plotting
112+
it in python using matplotlib proved insufficient: Keeping the algorithm
113+
and plotting code in sync requires a lot of effort when the C++ code frequently and substantially
114+
changes. Additionally, the python yaml parser was not able to cope with files that
115+
exceed a few hundred megabytes in size.
116+
117+
Therefore, I was looking for a C++ plotting library that was extremely to use
118+
and easy to add into an existing codebase, preferrably header-only. When I found
119+
none, I decided to write one myself, which is basically a C++ wrapper around
120+
matplotlib. As you can see from the above examples, plotting data and saving it
121+
to an image file can be done is as few as two lines of code.
122+
123+
The general approach of providing a simple C++ API for utilizing python code
124+
was later generalized and extracted into a separate, more powerful
125+
library in another project of mine, [wrappy](http://www.github.com/lava/wrappy).
126+
123127

124128
Todo/Issues/Wishlist
125129
--------------------
130+
* This library is not thread safe. Protect all concurrent access with a mutex.
131+
Sadly, this is not easy to fix since it is not caused by the library itself but
132+
by the python interpreter, which is itself not thread-safe.
133+
126134
* It would be nice to have a more object-oriented design with a Plot class which would allow
127135
multiple independent plots per program.
128136

0 commit comments

Comments
 (0)
0