Skip to content

Merge upstream #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 125 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
71bd59b
added support to semilogx, semilogy, and loglog.
flyvbee Oct 24, 2017
fb4cdf9
Support for stem and xkcd (#43)
Dec 6, 2017
4181748
Added wrapper for ion function
patrikfors Dec 1, 2017
1d79940
Fix typo (?)
alessandro-gentilini Mar 17, 2016
6aa4bc6
Fixes #30. Creates a function called import_numpy defined as an int i…
raldridge11 Oct 13, 2017
a221563
Adds close() function.
raldridge11 Oct 13, 2017
037022b
Fix build with python 3
kartikmohta Nov 3, 2017
660b7f3
Makefile: Build all examples
kartikmohta Dec 7, 2017
12923d7
Changed xkcd example to show a the plot instead of saving an image.
Dec 11, 2017
e0bdd04
Remove indentation for namespaces to reduce average line length.
Jan 11, 2018
76e16aa
Remove unnecessary overloads for stem() and name_plot().
Jan 11, 2018
c3e4a82
Correct a few reference counting errors.
Jan 11, 2018
f994996
Update minimal example to show a non-straight line.
Jan 11, 2018
b74e465
fix a small typo, no content changes
paralax Feb 12, 2018
1d23b28
added example for fill_inbetween.cpp
biphasic Feb 26, 2018
717e98e
Add figure_size
QuangTung97 May 5, 2018
331029f
Add support for xticks and yticks
alexdewar Sep 22, 2018
6e3fcf6
Update windows/VS2017 support
Chachay Feb 18, 2018
16a7fd6
Fix implementation of errorbar()
alexdewar Oct 3, 2018
697054c
Add quiver function for 4 vectors of uniform length
alexdewar Oct 2, 2018
c1ad253
Add example of quiver plot
alexdewar Oct 5, 2018
0791945
Update README and Makefile for quiver plot example.
Oct 6, 2018
00a4766
Fix indentation in basic example,
Oct 6, 2018
3d555d2
Add missing Py_DECREF to quiver()
alexdewar Oct 30, 2018
b60d338
Added text and suptitle
charasyn Oct 5, 2018
41a46e5
Fixed whitespace
charasyn Oct 5, 2018
e49f4f7
Chose a better name for the parameter to text
charasyn Oct 5, 2018
b124207
Add support for ginput() function
alexdewar Oct 31, 2018
dcb2322
Return figure number from figure function
alexdewar Oct 9, 2018
c92ad4c
Optionally pass figure number to figure() as argument
alexdewar Oct 9, 2018
073dd98
Add fignum_exists() function
alexdewar Oct 9, 2018
78719eb
added support for scatter plots
mdmosley1 Oct 14, 2018
8baa582
Add missing Py_DECREF in scatter function.
Jan 11, 2019
94f6c01
Add bar plot and subplots_adjust
LiuWeijunAntihos Dec 5, 2018
c19e00c
Add -std=c++11 for basic in Makefile
LiuWeijunAntihos Dec 5, 2018
65933e3
Officially require C++11.
Jan 11, 2019
69e58fe
Add plot_surface
AustinSchuh Dec 7, 2018
eae3824
Add picture and cpp file for new surface example.
Jan 11, 2019
0e39f8f
Load mplot3d module lazily.
Jan 11, 2019
d89878b
Add fill plot with example
Mar 11, 2019
d42a969
Add portability #defines PyLong_FromLong, PyUnicode_FromString
Jan 24, 2019
05087cf
Additional debug output if python module loading fails
Jan 24, 2019
d184e14
Add cumulative parameter to hist()
Jan 24, 2019
f64f1f6
Added missing <array> header
pauljurczak Mar 13, 2019
8babc98
Add kwargs for title, xlabel, ylabel
wei-chen-li Mar 20, 2019
07a73fa
Add dynamic plot class
oKermorgant Mar 13, 2019
c48ed30
Reduced example for dynamic plot class.
Apr 7, 2019
94c0215
Fixed type in update example.
Apr 8, 2019
4ace1ad
fix the figsize segfault bug
Cryoris May 30, 2019
019cd23
check functions with narrower error message scope
tkphd May 12, 2019
20e090e
Add support for imshow()
alexdewar Nov 6, 2018
bc7e457
Added basic example for imshow.
tkphd May 8, 2019
5dd7194
Add support for plot(y,keywords)
ocroquette Apr 19, 2019
2772217
Fix for OpenCV 4
alexdewar Jul 28, 2019
7fa134e
Fixes compiler warnings
cdbrkfxrpt Jul 22, 2019
f4ad842
Implements bar slightly more closely to matplotlib
cdbrkfxrpt Jul 22, 2019
d3137c5
Fix for imshow multiple definition error #48
pm-twice Sep 25, 2019
dbe8e4c
Makefile: Better numpy handling and make building more generic
alexdewar Jul 28, 2019
1c2a51f
Add .gitignore file for example binaries
alexdewar Jul 28, 2019
6ec72da
Fix: Allow for building examples individually
alexdewar Jul 28, 2019
1ac91f7
subplot2grid implementation and example
tkphd May 12, 2019
5adfbe0
Rearrange Makefile.
Oct 25, 2019
97729fd
Add possibility to pass additional parameters to scatter (like color …
zinsmatt Nov 24, 2019
6fb6a91
Fix multiple definition of subplot2grid
zinsmatt Nov 27, 2019
8297ae8
Implemented wrapper corresponding to tick_params in matplotlib
belre Nov 18, 2019
d687405
Added #include "unordered_map" to main header
Marcus-Davi Dec 4, 2019
61da78f
Updated cmake readme section.
Dec 12, 2019
7219c61
Updated wording in README.
Dec 20, 2019
f23347f
Added information about backend renderer issue on MacOS
Dec 17, 2019
f1af639
implement colorbar; requires returned PyObject of mappable object
tkphd May 12, 2019
de33a57
Rename make variable CXXFLAGS -> EXTRA_FLAGS
lava Mar 28, 2020
d283d47
Remove indentation around 'imshow()' functions
lava Mar 28, 2020
1809d7a
Adds axvline to function scope
cdbrkfxrpt Jan 5, 2020
52816e2
Adds boxplot, get_strarray and get_listlist
cdbrkfxrpt Jan 6, 2020
9b23ca0
Adds vim tempfiles to gitignore
cdbrkfxrpt Jan 6, 2020
811ebfb
Add 3D line plot and zlabel function.
brianphung Jan 1, 2020
41477fc
Add experimental documentation target
lava Mar 29, 2020
7f7b852
Fix numpy detection and provide some functions even when numpy is not…
lava Mar 31, 2020
ea527fd
add "inline" to get_array, color_bar, axvline
tomotakaeru Apr 5, 2020
2843ebb
delete unnecessary "inline" on get_array(vector<string>)
tomotakaeru Apr 6, 2020
e5ffc6c
ensure interpreter is initialized for suptitle & subplot
acxz Apr 12, 2020
d7839cc
:sparkle: Added a first version of Dockerfile
Gjacquenot Mar 8, 2020
7ef2559
:sparkle: Added a target to build docker image
Gjacquenot Mar 8, 2020
fa673c6
:sparkle: Added a first CI file
Gjacquenot Mar 8, 2020
a7c38ad
:pencil: Typo update in Readme.md
Gjacquenot Mar 8, 2020
823de00
:wrench: Moved all elements related to docker build in contrib
Gjacquenot Mar 28, 2020
9595628
Replace occurrences of std::unordered_map<> with std::map<>
mateogianolio Apr 3, 2020
1243814
Add vcpkg installation instructions
Feb 26, 2020
edb4074
Reword libpython dependency; move vcpkg section
lava Apr 18, 2020
d741050
Fix use-after-free bug when plotting unknown numeric types
lava Apr 21, 2020
ecf3a8d
Add native numpy handling when plotting vectors of (unsigned) long long
lava Apr 21, 2020
bf2be71
Update python-config invocation in Makefile
lava May 2, 2020
f5f8ce3
Move Python.h include into first position
lava May 2, 2020
d612b52
Fix python3.8 segfault for the named_* family of functions
lava May 2, 2020
60dcd64
Sprinkle calls to interpreter::get() all over the codebase
lava May 11, 2020
480af0f
Added support for axvspan
Apr 20, 2020
1079121
a few of the parameters are floats. This is a quick hack to get a cou…
Apr 20, 2020
374dcd0
Added arrow, cla, margins, contour
JBPennington Apr 24, 2020
b79ca6d
feat: Add keyword argument support to legend()
takoloco Jun 14, 2020
7d0e695
include ldflags instead of libs
Cryoris May 23, 2020
f4b49a3
Fix issue lava/matplotlib-cpp#124
bbalp Aug 15, 2020
f2bf7a4
Add missing call to initialize interpreter in 'modern' example
lava Aug 27, 2020
6f841d4
Added support to barh plot method
ensismoebius May 26, 2020
dfe5a69
Fix whitespace error
lava Aug 27, 2020
b6f58a5
Suggestion: Give more multithreading flexibility
thesmallcreeper Jun 18, 2020
70d508f
Expand comment for new interkeeper() function
lava Aug 27, 2020
80bc9cd
Add 3D quiver support
sapphous Oct 31, 2020
9d19657
Add 3D scatter plots, allow more than one 3d plot on the same figure …
Baggins800 Jan 17, 2021
d1b7c72
Add #include <string> for std::stod
leha-bot Aug 28, 2020
2bf4f26
Fix #221 and #225
williamleong Oct 2, 2020
3af24b4
Adding possibility to choose dpi when saving
Nov 27, 2020
490fa9c
Fix memory leaks in xlim() and ylim()
alexdewar Feb 19, 2021
08ff087
Add modern cmake support
fferflo Feb 10, 2021
3d3f9da
Unbreak examples by moving 'fig_number' paramter to the end of the list
Mar 26, 2021
cab80f3
Remove obsoleted build systems
Mar 26, 2021
1875696
Added 'set_aspect' and set_aspect_equal function
pnarvor Mar 31, 2021
ec37453
add axhline
Cryoris May 23, 2020
bbfb240
add contour plot
Cryoris May 23, 2020
9ff7a4b
add spy
Cryoris May 23, 2020
630ba84
Some bugfixes and adjustments for contour/spy
Apr 2, 2021
5b88e8b
Change line endings in CMakeLists.txt
Apr 2, 2021
1480780
Updated named plots to infer different datatypes in case of x and y i…
SpiritSeeker Sep 18, 2020
6150108
added scatter with colors
kesha787898 Feb 27, 2021
3dda526
Fix a missing M_PI in windows environment
yoneken Apr 13, 2021
ef0383f
Enable cmake include definition
yoneken Apr 13, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@

# Build
/examples/build/*

# vim temp files
*.sw*
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: minimal
dist: trusty
services:
- docker
script:
- make -C contrib docker_build
133 changes: 133 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
cmake_minimum_required(VERSION 3.8 FATAL_ERROR)
project(matplotlib_cpp LANGUAGES CXX)

include(GNUInstallDirs)
set(PACKAGE_NAME matplotlib_cpp)
set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/${PACKAGE_NAME}/cmake)


# Library target
add_library(matplotlib_cpp INTERFACE)
target_include_directories(matplotlib_cpp
INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/examples>
$<INSTALL_INTERFACE:include>
)
target_compile_features(matplotlib_cpp INTERFACE
cxx_std_11
)
# TODO: Use `Development.Embed` component when requiring cmake >= 3.18
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
target_link_libraries(matplotlib_cpp INTERFACE
Python3::Python
Python3::Module
)
find_package(Python3 COMPONENTS NumPy)
if(Python3_NumPy_FOUND)
target_link_libraries(matplotlib_cpp INTERFACE
Python3::NumPy
)
else()
target_compile_definitions(matplotlib_cpp INTERFACE WITHOUT_NUMPY)
endif()
install(
TARGETS matplotlib_cpp
EXPORT install_targets
)


# Examples
add_executable(minimal examples/minimal.cpp)
target_link_libraries(minimal PRIVATE matplotlib_cpp)
set_target_properties(minimal PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")

add_executable(basic examples/basic.cpp)
target_link_libraries(basic PRIVATE matplotlib_cpp)
set_target_properties(basic PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")

add_executable(modern examples/modern.cpp)
target_link_libraries(modern PRIVATE matplotlib_cpp)
set_target_properties(modern PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")

add_executable(animation examples/animation.cpp)
target_link_libraries(animation PRIVATE matplotlib_cpp)
set_target_properties(animation PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")

add_executable(nonblock examples/nonblock.cpp)
target_link_libraries(nonblock PRIVATE matplotlib_cpp)
set_target_properties(nonblock PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")

add_executable(xkcd examples/xkcd.cpp)
target_link_libraries(xkcd PRIVATE matplotlib_cpp)
set_target_properties(xkcd PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")

add_executable(bar examples/bar.cpp)
target_link_libraries(bar PRIVATE matplotlib_cpp)
set_target_properties(bar PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")

add_executable(fill_inbetween examples/fill_inbetween.cpp)
target_link_libraries(fill_inbetween PRIVATE matplotlib_cpp)
set_target_properties(fill_inbetween PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")

add_executable(fill examples/fill.cpp)
target_link_libraries(fill PRIVATE matplotlib_cpp)
set_target_properties(fill PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")

add_executable(update examples/update.cpp)
target_link_libraries(update PRIVATE matplotlib_cpp)
set_target_properties(update PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")

add_executable(subplot2grid examples/subplot2grid.cpp)
target_link_libraries(subplot2grid PRIVATE matplotlib_cpp)
set_target_properties(subplot2grid PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")

add_executable(lines3d examples/lines3d.cpp)
target_link_libraries(lines3d PRIVATE matplotlib_cpp)
set_target_properties(lines3d PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")

if(Python3_NumPy_FOUND)
add_executable(surface examples/surface.cpp)
target_link_libraries(surface PRIVATE matplotlib_cpp)
set_target_properties(surface PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")

add_executable(colorbar examples/colorbar.cpp)
target_link_libraries(colorbar PRIVATE matplotlib_cpp)
set_target_properties(colorbar PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
add_executable(contour examples/contour.cpp)
target_link_libraries(contour PRIVATE matplotlib_cpp)
set_target_properties(contour PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")

add_executable(spy examples/spy.cpp)
target_link_libraries(spy PRIVATE matplotlib_cpp)
set_target_properties(spy PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
endif()


# Install headers
install(FILES
"${PROJECT_SOURCE_DIR}/matplotlibcpp.h"
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})


# Install targets file
install(EXPORT install_targets
FILE
${PACKAGE_NAME}Targets.cmake
NAMESPACE
${PACKAGE_NAME}::
DESTINATION
${INSTALL_CONFIGDIR}
)


# Install matplotlib_cppConfig.cmake
include(CMakePackageConfigHelpers)
configure_package_config_file(
${CMAKE_CURRENT_SOURCE_DIR}/cmake/${PACKAGE_NAME}Config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}Config.cmake
INSTALL_DESTINATION ${INSTALL_CONFIGDIR}
)
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}Config.cmake
DESTINATION ${INSTALL_CONFIGDIR}
)
13 changes: 0 additions & 13 deletions Makefile

This file was deleted.

Loading