@@ -91,21 +91,6 @@ matplotlib-cpp doesn't require C++11, but will enable some additional syntactic
91
91
92
92
Result: ![ Modern example] ( ./examples/modern.png )
93
93
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
-
109
94
Installation
110
95
------------
111
96
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
120
105
matplotlib-cpp.
121
106
(There should be no problems using python3 instead of python2.7, if desired)
122
107
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
+
123
127
124
128
Todo/Issues/Wishlist
125
129
--------------------
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
+
126
134
* It would be nice to have a more object-oriented design with a Plot class which would allow
127
135
multiple independent plots per program.
128
136
0 commit comments