Movatterモバイル変換


[0]ホーム

URL:


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

Matplot++: A C++ Graphics Library for Data Visualization 📊🗾

License

NotificationsYou must be signed in to change notification settings

alandefreitas/matplotplusplus

Repository files navigation

A C++ Graphics Library for Data Visualization

Matplot++


Data visualization can help programmers and scientists identify trends in their data and efficiently communicate these results with their peers. Modern C++ is being used for a variety of scientific applications, and this environment can benefit considerably from graphics libraries that attend the typical design goals toward scientific data visualization. Besides the option of exporting results to other environments, the customary alternatives in C++ are either non-dedicated libraries that depend on existing user interfaces or bindings to other languages.Matplot++ is a graphics library for data visualization that provides interactive plotting, means for exporting plots in high-quality formats for scientific publications, a compact syntax consistent with similar libraries, dozens of plot categories with specialized algorithms, multiple coding styles, and supports generic backends.


Latest ReleaseDocumentationDiscussions


FacebookQZoneWeiboRedditTwitterLinkedInWhatsAppLine.meTelegram.meHackerNews


Table of Contents

Gallery

example_plot_1example_plot3_1example_stairs_1example_errorbar_1example_area_1example_loglog_1example_fplot_1example_fimplicit_1example_histogram_1example_boxplot_1example_scatter_1example_scatter3_1example_binscatter_1example_plotmatrix_1example_parallelplot_1example_pie_1example_heatmap_1example_wordcloud_1example_bar_1example_pareto_1example_stem_1example_stem3_1example_geoplot_1example_geoscatter_1example_geobubble_1example_geodensityplot_1example_polarplot_1example_polarscatter_1example_polarhistogram_1example_compass_1example_ezpolar_1example_contour_1example_contourf_1example_fcontour_1example_feather_1example_quiver_1example_surf_1example_surfc_1example_mesh_1example_meshc_1example_meshz_1example_fsurf_1example_fmesh_1example_waterfall_1example_fence_1example_ribbon_1example_graph_1example_digraph_1example_imshow_1example_image_1example_imagesc_1

Complete Gallery

example_plot_1example_plot_2example_plot_3example_plot_4example_plot_5example_plot_6example_plot_7example_plot_8example_plot_9example_plot_10example_plot_11example_plot_12example_plot3_1example_plot3_2example_plot3_3example_plot3_4example_plot3_5example_plot3_6example_plot3_7example_plot3_8example_plot3_9example_plot3_10example_stairs_1example_stairs_2example_stairs_3example_stairs_4example_stairs_5example_stairs_6example_stairs_7example_stairs_8example_stairs_9example_stairs_10example_errorbar_1example_errorbar_2example_errorbar_3example_errorbar_4example_errorbar_5example_errorbar_6example_errorbar_7example_errorbar_8example_errorbar_9example_errorbar_10example_area_1example_area_2example_area_3example_area_4example_loglog_1example_loglog_2example_loglog_3example_loglog_4example_loglog_5example_loglog_6example_loglog_7example_loglog_8example_loglog_9example_semilogx_1example_semilogy_1example_fplot_1example_fplot_2example_fplot_3example_fplot_4example_fplot_5example_fplot_6example_fplot3_1example_fplot3_2example_fplot3_3example_fplot3_4example_fplot3_5example_fimplicit_1example_fimplicit_2example_fimplicit_3example_fimplicit_4example_histogram_1example_histogram_2example_histogram_3example_histogram_4example_histogram_5example_histogram_6example_histogram_7example_histogram_8example_histogram_9example_histogram_10example_histogram_11example_histogram_12example_histogram_14example_boxplot_1example_boxplot_2example_boxplot_3example_scatter_1example_scatter_2example_scatter_3example_scatter_4example_scatter_5example_scatter_6example_scatter_7example_scatter_8example_scatter3_1example_scatter3_2example_scatter3_3example_scatter3_4example_scatter3_5example_scatter3_6example_binscatter_1example_binscatter_2example_binscatter_3example_binscatter_4example_binscatter_5example_binscatter_6example_binscatter_7example_plotmatrix_1example_plotmatrix_2example_plotmatrix_3example_plotmatrix_4example_parallelplot_1example_parallelplot_2example_parallelplot_3example_pie_1example_pie_2example_pie_3example_pie_4example_pie_5example_pie_6example_heatmap_1example_heatmap_2example_heatmap_3example_heatmap_4example_heatmap_5example_heatmap_6example_heatmap_7example_wordcloud_1example_wordcloud_3example_wordcloud_4example_wordcloud_4example_bar_1example_bar_2example_bar_3example_bar_4example_bar_5example_bar_6example_bar_7example_bar_8example_bar_9example_bar_10example_bar_11example_bar_12example_bar_13example_pareto_1example_pareto_2example_pareto_3example_pareto_4example_stem_1example_stem_2example_stem_3example_stem_4example_stem_5example_stem_6example_stem_7example_stem_8example_stem_9example_stem3_1example_stem3_2example_stem3_3example_stem3_4example_stem3_5example_stem3_6example_stem3_7example_stem3_8example_stem3_9example_stem3_10example_stem3_11example_geoplot_1example_geoplot_2example_geoplot_3example_geoplot_4example_geoplot_5example_geoplot_6example_geoplot_7example_geoscatter_1example_geoscatter_2example_geobubble_1example_geobubble_2example_geodensityplot_1example_polarplot_1example_polarplot_2example_polarplot_3example_polarplot_4example_polarplot_5example_polarplot_6example_polarplot_7example_polarplot_8example_polarscatter_1example_polarscatter_2example_polarscatter_3example_polarscatter_4example_polarscatter_5example_polarscatter_6example_polarhistogram_1example_polarhistogram_2example_polarhistogram_3example_polarhistogram_4example_polarhistogram_5example_compass_1example_compass_2example_ezpolar_1example_ezpolar_2example_contour_1example_contour_2example_contour_3example_contour_4example_contour_5example_contour_6example_contour_7example_contour_8example_contourf_1example_contourf_2example_contourf_3example_contourf_4example_contourf_5example_contourf_6example_fcontour_1example_fcontour_2example_fcontour_3example_fcontour_4example_fcontour_5example_fcontour_6example_fcontour_7example_fcontour_8example_fcontour_9example_fcontour_10example_fcontour_11example_feather_1example_quiver_1example_quiver_2example_quiver_3example_quiver_4example_quiver_5example_quiver_6example_quiver3_1example_quiver3_2example_surf_1example_surf_2example_surf_3example_surf_4example_surf_5example_surf_6example_surfc_1example_surfc_2example_surfc_3example_surfc_4example_mesh_1example_mesh_2example_mesh_3example_mesh_4example_meshc_1example_meshc_2example_meshc_3example_meshz_1example_meshz_2example_meshz_3example_fsurf_1example_fsurf_2example_fsurf_3example_fsurf_4example_fsurf_5example_fsurf_6example_fsurf_7example_fsurf_8example_fmesh_1example_fmesh_2example_fmesh_3example_fmesh_4example_waterfall_1example_waterfall_2example_waterfall_3example_fence_1example_fence_2example_fence_3example_ribbon_1example_ribbon_2example_ribbon_3example_ribbon_4example_graph_1example_graph_2example_graph_3example_graph_4example_graph_5example_graph_6example_digraph_1example_digraph_2example_digraph_3example_imshow_1example_imshow_2example_imshow_3example_imshow_4example_imshow_5example_imshow_6example_imshow_7example_imshow_8example_imshow_9example_imshow_10example_imshow_11example_image_1example_image_2example_image_3example_image_4example_image_5example_imagesc_1example_imagesc_2example_imagesc_3example_imagesc_4example_text_1example_text_2example_text_3example_text_4example_text_5example_text_6example_text_7example_text_8example_textarrow_1example_textarrow_2example_rectangle_1example_rectangle_2example_rectangle_3example_rectangle_4example_rectangle_5example_fill_1example_ellipse_1example_textbox_1example_arrow_1example_arrow_2example_line_1example_title_1example_title_2example_title_3example_title_4example_title_5example_title_6example_title_7example_title_8example_sgtitle_1example_sgtitle_2example_xlabel_1example_xlabel_2example_xlabel_3example_xlabel_4example_xlabel_5example_xlabel_6example_xlabel_7example_xlabel_8example_ylabel_1example_ylabel_2example_ylabel_3example_ylabel_4example_ylabel_5example_ylabel_6example_ylabel_7example_ylabel_8example_zlabel_1example_zlabel_2example_zlabel_3example_legend_1example_legend_2example_legend_3example_legend_4example_legend_5example_legend_6example_legend_7example_legend_8example_legend_9example_xlim_1example_xlim_2example_xlim_3example_xlim_4example_xlim_5example_xlim_6example_ylim_1example_ylim_2example_ylim_3example_ylim_4example_ylim_5example_ylim_6example_zlim_1example_zlim_2example_zlim_3example_zlim_4example_zlim_5example_zlim_6example_axis_1example_axis_2example_axis_3example_axis_4example_axis_5example_axis_6example_axis_7example_axis_8example_box_1example_box_2example_box_3example_grid_1example_grid_2example_grid_3example_grid_4example_xticks_1example_xticks_2example_xticks_3example_xticks_4example_xticks_5example_xticks_6example_xticks_7example_xticks_8example_yticks_1example_yticks_2example_yticks_3example_yticks_4example_yticks_5example_yticks_6example_yticks_7example_yticks_8example_zticks_1example_zticks_2example_zticks_3example_zticks_4example_zticks_5example_zticks_6example_xticklabels_1example_xticklabels_2example_xticklabels_3example_xticklabels_4example_yticklabels_1example_yticklabels_2example_yticklabels_3example_yticklabels_4example_xtickformat_1example_xtickformat_2example_xtickformat_3example_xtickformat_4example_xtickformat_5example_ytickformat_1example_ytickformat_2example_ytickformat_3example_ytickformat_4example_ytickformat_5example_ztickformat_1example_ztickformat_2example_ztickformat_3example_ztickformat_4example_ztickformat_5example_xtickangle_1example_xtickangle_2example_xtickangle_3example_ytickangle_1example_ytickangle_2example_ytickangle_3example_hold_1example_hold_2example_hold_3example_hold_4example_yyaxis_1example_yyaxis_2example_yyaxis_3example_yyaxis_4example_yyaxis_5example_yyaxis_6example_yyaxis_7example_colororder_1example_colororder_2example_colororder_3example_colororder_4example_colororder_5example_colororder_6example_colororder_7example_subplot_1example_subplot_2example_subplot_3example_subplot_4example_subplot_5example_subplot_6example_subplot_7example_subplot_8example_subplot_9example_subplot_10example_subplot_11example_subplot_12example_subplot_13example_tiledlayout_1example_tiledlayout_2example_tiledlayout_3example_tiledlayout_4example_tiledlayout_5example_tiledlayout_6example_tiledlayout_7example_tiledlayout_8example_colormap_1example_colormap_2example_colormap_3example_colormap_4example_colormap_5example_colormap_6example_colormap_7example_colormap_8example_colormap_9example_colorbar_1example_colorbar_2example_colorbar_3example_colorbar_4example_colorbar_5example_colorbar_6example_colorbar_7example_rgbplot_1example_rgbplot_2example_view_1example_view_2example_view_3example_view_4example_view_5example_view_6example_lighting_1example_lighting_2example_lighting_3example_lighting_4example_lighting_5example_lighting_6example_figure_1example_figure_2example_figure_3example_line_spec_1example_axes_1example_axes_2example_axes_3example_axes_4example_cla_1example_cla_2example_cla_3example_save_1example_save_2example_save_3example_save_4example_save_5example_save_6example_save_7example_save_8

Integration

Package Managers

Vcpkg

Vcpkg users can install Matplot++ with thematplotplusplus port:

vcpkg install matplotplusplus

This formula is acontribution tovcpkg by@myd7349.

Homebrew

Mac users can install Matplot++ withHomebrew:

brew install matplotplusplus

This formula is acontribution toHomebrew byAndrew Kane.

Arch Linux

Matplot++ is available in the Arch User Repository(AUR) asmatplotplusplus.

Note you can manually install the package by following the instructions on theArch Wikior use anAUR helper likeyay(recommended for ease of install).

yay -S matplotplusplus

To discuss any issues related to this package refer to the comments section onthe AUR page ofmatplotplusplushere.

CMake

Embed as Subdirectory

You can use Matplot++ directly in CMake projects as a subproject, without installing it. This is convenient if you are experimenting with this library for the first time or don't expect your users to have Matplot++ installed on their systems.

Check if you haveCmake 3.14+ installed:

cmake --version

Clone the whole project

git clone https://github.com/alandefreitas/matplotplusplus/

and add the subdirectory to your CMake project:

add_subdirectory(matplotplusplus)

When creating your executable, link the library to the targets you want:

add_executable(my_targetmain.cpp)target_link_libraries(my_targetPUBLICmatplot)

Add this header to your source files:

#include<matplot/matplot.h>

However, in larger projects, it's always recommended to look for Matplot++ withfind_package before including it as a subdirectory to avoidODR errors.

Install as a Package via CMake

If you have CMake 3.21 or greater, you can use thesystem build preset tobuild the package system-wide:

cmake --preset=systemcmake --build --preset=systemsudo cmake --install build/system

Alternatively, if theCMAKE_PREFIX_PATH environment variable is set to$HOME/.local, then you can install it locally. This can be set in/etc/profileor your shell config. This will not affect discovery of packages installedsystem-wide.

export CMAKE_PREFIX_PATH="$HOME/.local"

This has the advantage of notrequiring sudo, and matplotplusplus will be installed in$HOME/.local.

cmake --preset=localcmake --build --preset=localcmake --install build/local

You can now use it from CMake withfind_package:

find_package(Matplot++REQUIRED)target_link_libraries(<yourtarget>Matplot++::matplot)

If you're using a version of CMake too old to support presets, then building withthe system preset is equivilant to:

cmake -B build/system         \    -DMATPLOTPP_BUILD_EXAMPLES=OFF      \    -DMATPLOTPP_BUILD_SHARED_LIBS=ON    \    -DMATPLOTPP_BUILD_TESTS=OFF         \    -DCMAKE_BUILD_TYPE=Release \    -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ONcmake --build build/system

While building with the local preset is equivilant to:

cmake -B build/local                      \    -DMATPLOTPP_BUILD_EXAMPLES=OFF                  \    -DMATPLOTPP_BUILD_SHARED_LIBS=ON                \    -DMATPLOTPP_BUILD_TESTS=OFF                     \    -DCMAKE_BUILD_TYPE=Release            \    -DCMAKE_INSTALL_PREFIX="$HOME/.local" \    -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ONcmake --build build/local

Embed with Automatic Download

FetchContent is a CMake command that can automatically download the Matplot++ repository. Check if you haveCmake 3.14+ installed:

cmake --version

Include FetchContent in your CMake build script:

include(FetchContent)

Declare the source for the contents:

FetchContent_Declare(matplotplusplusGIT_REPOSITORYhttps://github.com/alandefreitas/matplotplusplusGIT_TAGorigin/master)# or whatever tag you want

Let CMake download the repository and include it as a subdirectory.

FetchContent_GetProperties(matplotplusplus)if(NOTmatplotplusplus_POPULATED)FetchContent_Populate(matplotplusplus)add_subdirectory(${matplotplusplus_SOURCE_DIR}${matplotplusplus_BINARY_DIR}EXCLUDE_FROM_ALL)endif()

When creating your executable, link the library to the targets you want:

add_executable(my_target main.cpp)target_link_libraries(my_target PUBLIC matplot)

Then add this header to your source files:

#include<matplot/matplot.h>

However, in larger projects, it's always recommended to look for Matplot++ withfind_package before including it as a subdirectory to avoidODR errors.

Embed with CPM.cmake

CPM.cmake is a nice wrapper around the CMakeFetchContent function.

Check if you haveCmake 3.14+ installed:

cmake --version

InstallCPM.cmake and then use this command to add Matplot++ to your build script:

CPMAddPackage(NAMEmatplotplusplusGITHUB_REPOSITORYalandefreitas/matplotplusplusGIT_TAGorigin/master# or whatever tag you want)# ...target_link_libraries(my_targetPUBLICmatplot)

Then add this header to your source files:

#include<matplot/matplot.h>

However, in larger projects, it's always recommended to look for Matplot++ withfind_package before including it as a subdirectory to avoidODR errors.

You can use:

option(CPM_USE_LOCAL_PACKAGES"Try `find_package` before downloading dependencies"ON)

in your build script to let CPM.cmake do that for you.

Find as External Package

If you have the library installed on your system, you can callfind_package() from your CMake build script.

find_package(Matplot++REQUIRED)

When creating your executable, link the library to the targets you want:

add_executable(my_targetmain.cpp)target_link_libraries(my_targetPUBLICMatplot++::matplot)

Then add this header to your source files:

#include<matplot/matplot.h>

You can see a complete example intest/integration/CMakeLists.txt.

CMake should be able to locate theMatplot++Config.cmake script automatically if you installed the library under/usr/local/ (Linux / Mac OS). Unfortunately, there is no easy default directory forfind_package on Windows.

!!! warning "Default directories"

By default, the library is likely to be in `/usr/local/` (Linux / Mac OS) or `C:/Program Files/` (Windows). The installer will try to find the directory where you usually keep your libraries but that's not always perfect.

!!! warning "Finding packages on Windows"

Unfortunately, CMake does not have a single default directory for packages on Windows like `/usr/local/lib`. If CMake cannot find Matplot++ on Windows or if you installed the library outside the default directory on Linux/Mac OS, there are a few [options](https://stackoverflow.com/questions/21314893/what-is-the-default-search-path-for-find-package-in-windows-using-cmake):* **Environment Variables**: The most reliable way to set this default directory is through environment variables. You can create an environment variable `MATPLOTPP_DIR` and then add `$ENV{MATPLOTPP_DIR}` to the `HINTS` section of the `find_package` command. This tends to be more convenient than requiring the path on the command line every time. Starting with version 3.12, CMake now implicitly considers the `<PackageName>_Root` environment variable a HINT for every `find_package` call.* **Package Registry**: CMake offers the [Package Registry](https://cmake.org/cmake/help/v3.5/manual/cmake-packages.7.html#package-registry) as an alternative mechanism for finding package locations. CMake maintains a list of package information in the Windows registry under `HKEY_CURRENT_USER\Software\Kitware\CMake\Packages\`.* **Append CMAKE_MODULE_PATH**: You can append more directories to [`CMAKE_MODULE_PATH`](https://cmake.org/cmake/help/latest/variable/CMAKE_MODULE_PATH.html) with something like `list(APPEND CMAKE_MODULE_PATH "C:\\Program Files\\matplotplusplus 1.0.1")`. `CMAKE_MODULE_PATH` is a list of search paths for CMake modules to be loaded by the `include()` or `find_package()` commands.* **Set the DIR variable directly**: Directly set the `Matplot++_DIR` variable with something like `set(Matplot++_DIR "C:\\Program Files\\matplotplusplus 1.0.1\\lib\\cmake\\Matplot++")`. This might be good enough for small local projects but it is hard-coding the directory in your build script. When your library gets out of your local environment, you need to choose one of the other options above (better) or make this variable an option and require the user to provide the directory on the command line every time (worse).

Supporting Both

It's often useful to let your build script download Matplot++ when find_package fails. If using CPM.cmake, you can set theCPM_USE_LOCAL_PACKAGES option to try tofind_package(Matplot++) before download Matplot++.

If using FetchContent, you can use the following pattern:

find_package(Matplot++QUIET)if(NOTMatplot++_FOUND)# Put your FetchContent or CPM.cmake script hereendif()

Install

Binary Packages

Get the binary package from therelease section. These binaries refer to the last release version of Matplot++.

If you need a more recent version of Matplot++, you can download thebinary packages from the CI artifacts or build the libraryfrom the source files.

Build from Source

Dependencies

C++17

Make sure your C++ compiler supports C++17:

=== "Ubuntu + GCC"

g++ --version

=== "Mac Os + Clang"

clang --version

=== "Windows + MSVC"

!!! warning ""    * Visit the [Visual Studio](https://visualstudio.microsoft.com) website    * Download Git from [https://git-scm.com/download/win](https://git-scm.com/download/win) and install it

The output should be something like:

=== "Ubuntu + GCC"

g++-8 (Ubuntu 8.4.0-1ubuntu1~18.04) 8.4.0

=== "Mac Os + Clang"

Apple clang version 11.0.0 (clang-1100.0.33.8)

=== "Windows + MSVC"

!!! warning ""    * Visit the [Visual Studio](https://visualstudio.microsoft.com) website    * Download Git from [https://git-scm.com/download/win](https://git-scm.com/download/win) and install it

If you need to update your compiler:

=== "Ubuntu + GCC"

# install GCC-8sudo apt updatesudo apt install gcc-8sudo apt install g++-8

To update to any other version, like GCC-9 or GCC-10:

sudo apt install build-essentialsudo add-apt-repository ppa:ubuntu-toolchain-r/testsudo apt-get updatesudo apt install g++-10

Once you installed a newer version of GCC, you can link it toupdate-alternatives. For instance, if you have GCC-7 and GCC-10, you can link them with:

sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 7sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 7sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 10sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 10

You can now useupdate-alternatives to set your defaultgcc andg++ to a more recent version:

update-alternatives --config g++update-alternatives --config gcc

=== "Mac Os + Clang"

# download clangcurl --output clang.tar.xz -L https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/clang+llvm-11.0.0-x86_64-apple-darwin.tar.xzmkdir clangtar -xvJf clang.tar.xz -C clang# copy files to /usr/localcd clang/clang+llvm-11.0.0-x86_64-apple-darwinsudo cp -R* /usr/local/# update default compilerexport CXX=/usr/local/bin/clang++

=== "Windows + MSVC"

!!! warning ""    * Visit the [Visual Studio](https://visualstudio.microsoft.com) website    * Download Git from [https://git-scm.com/download/win](https://git-scm.com/download/win) and install it

CMake 3.14+

Also check your CMake version is at least 3.14+:

=== "Ubuntu + GCC"

cmake --version

=== "Mac Os + Clang"

cmake --version

=== "Windows + MSVC"

cmake --version

If CMake is not installed or its version is older than CMake 3.14, update it with

=== "Ubuntu + GCC"

sudo apt upgrade cmake
!!! warning ""    Alternatively, download the most recent version from [cmake.org](https://cmake.org/).

=== "Mac Os + Clang"

brew upgrade cmake
!!! warning "Homebrew"    If this command fails because you don't have [Homebrew](https://brew.sh) on your computer, you can install it with
/bin/bash -c"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
    or you can follow the instructions in [https://brew.sh](https://brew.sh).!!! warning ""    Alternatively, download the most recent version from [cmake.org](https://cmake.org/).

=== "Windows + MSVC"

!!! warning ""    Download the most recent version from [cmake.org](https://cmake.org/).

Gnuplot 5.2.6+

Install Gnuplot 5.2.6+ (Required at runtime)

=== "Ubuntu + GCC"

sudo apt updatesudo apt install gnuplot
!!! note ""    Or download the latest version from [www.gnuplot.info](http://www.gnuplot.info). If you're using an installer, make sure you mark the option "Add application directory to your PATH environment variable".

=== "Mac Os + Clang"

brew install gnuplot
!!! note ""    Or download the latest version from [www.gnuplot.info](http://www.gnuplot.info). If you're using an installer, make sure you mark the option "Add application directory to your PATH environment variable".

=== "Windows + MSVC"

!!! warning ""    Download Gnuplot from [www.gnuplot.info](http://www.gnuplot.info) and install it.    If you're using the Gnuplot installer, make sure you mark the option "Add application directory to your PATH environment variable"!!! warning "Windows Gnuplot Terminals"    If the Matplot++ examples don't display without console errors and gnuplot running, try to re-install Gnuplot with the wxt terminal.

Optional Dependencies

The build script will also look for theseoptional dependencies for manipulating images:

  • JPEG
  • TIFF
  • ZLIB
  • PNG
  • LAPACK
  • BLAS
  • FFTW
  • OpenCV

Embedded Dependencies

There are two dependencies insource/3rd_party. These dependencies are bundled, so you don't have to worry about them:

  • olvb/nodesoup
  • dtschump/CImg

You can defineMATPLOTPP_WITH_SYSTEM_NODESOUP=ON orMATPLOTPP_WITH_SYSTEM_CIMG=ON in the cmake command line to use a system-provided version of these dependencies.

OpenGL Dependencies

There's an extra targetmatplot_opengl with the experimentalOpenGL backend. You need to defineMATPLOTPP_BUILD_EXPERIMENTAL_OPENGL_BACKEND=ON in the CMake command line to build that target. In that case, the build script will also look for these extra dependencies:

  • OpenGL
  • GLAD
  • GLFW3

If these dependencies are not found, the build script will download them. In any case, you can install these dependencies with:

=== "Ubuntu + GCC"

sudo apt-get install libglfw3-dev

=== "Mac Os + Clang"

!!! note ""    Download GLFW3 from https://www.glfw.org

=== "Windows + MSVC"

!!! note ""    Download GLFW3 from https://www.glfw.org

You can also see all dependencies insource/3rd_party/CMakeLists.txt.

Build and Install

Building Examples

This will build the examples in thebuild/examples directory:

=== "Ubuntu + GCC"

mkdir buildcd buildcmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-O2"sudo cmake --build. --parallel 2 --config Release

=== "Mac Os + Clang"

mkdir buildcd buildcmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-O2"cmake --build. --parallel 2 --config Release

=== "Windows + MSVC"

mkdir buildcd buildcmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="/O2"cmake --build. --parallel 2 --config Release

!!! hint "Parallel Build"Replace--parallel 2 with--parallel <number of cores in your machine>

!!! note "Setting C++ Compiler"

If your C++ compiler that supports C++17 is not your default compiler, make sure you provide CMake with the compiler location with the DCMAKE_C_COMPILER and DCMAKE_CXX_COMPILER options. For instance:
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-O2" -DCMAKE_C_COMPILER=/usr/bin/gcc-8 -DCMAKE_CXX_COMPILER=/usr/bin/g++-8

Installing

You can 1) use-DMATPLOTPP_BUILD_EXAMPLES=OFF -DMATPLOTPP_BUILD_TESTS=OFF to bypass the examples and tests, and then 2)cmake --install . to install Matplot++ on your system:

=== "Ubuntu + GCC"

mkdir buildcd buildcmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-O2" -DMATPLOTPP_BUILD_EXAMPLES=OFF -DMATPLOTPP_BUILD_TESTS=OFFsudo cmake --build. --parallel 2 --config Releasesudo cmake --install.

=== "Mac Os + Clang"

mkdir buildcd buildcmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-O2" -DMATPLOTPP_BUILD_EXAMPLES=OFF -DMATPLOTPP_BUILD_TESTS=OFFcmake --build. --parallel 2 --config Releasecmake --install.

=== "Windows + MSVC"

mkdir buildcd buildcmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="/O2" -DMATPLOTPP_BUILD_EXAMPLES=OFF -DMATPLOTPP_BUILD_TESTS=OFFcmake --build. --parallel 2 --config Releasecmake --install.

!!! hint "Parallel Build"Replace--parallel 2 with--parallel <number of cores in your machine>

Create Packages

You can also create the binary packages to install Matplot++ on other systems:

=== "Ubuntu + GCC"

sudo cpack.

=== "Mac Os + Clang"

cpack.

=== "Windows + MSVC"

cpack.

Plot Types

Line Plots

Line Plot |Line Plot 3D |Stairs |Error Bars |Area |Loglog Plot |Semilogx Plot |Semilogy Plot |Function Plot |Function Plot 3D |Implicit function

Line Plot

!!! tipUse these examples to understand how to quickly use the library for data visualization. If you are interested in understanding how the library works, you can later read the details in the completearticle.

plot(x,y);

Wherex andy are are any value ranges.

=== "Plot"

example_plot_1

=== "C++"

--8<--"examples/line_plot/plot/plot_1.cpp"
More examples

example_plot_2example_plot_3example_plot_4example_plot_5example_plot_6example_plot_7example_plot_8example_plot_9example_plot_10example_plot_11example_plot_12

!!! tipSetters return a reference to*this to allow method chaining:

plot(x,y)->line_width(2).color("red");

!!! tipThese examples use free-standing functions to create plots. You can also use a object-oriented style for plots. We discuss these coding styles in the SectionCoding Styles.

More Examples:

===! "Plot"

example_plot_2

=== "C++"

--8<--"examples/line_plot/plot/plot_2.cpp"

===! "Plot"

example_plot_3

=== "C++"

--8<--"examples/line_plot/plot/plot_3.cpp"

===! "Plot"

example_plot_4

=== "C++"

--8<--"examples/line_plot/plot/plot_4.cpp"

===! "Plot"

example_plot_5

=== "C++"

--8<--"examples/line_plot/plot/plot_5.cpp"

===! "Plot"

example_plot_6

=== "C++"

--8<--"examples/line_plot/plot/plot_6.cpp"

===! "Plot"

example_plot_7

=== "C++"

--8<--"examples/line_plot/plot/plot_7.cpp"

===! "Plot"

example_plot_8

=== "C++"

--8<--"examples/line_plot/plot/plot_8.cpp"

===! "Plot"

example_plot_9

=== "C++"

--8<--"examples/line_plot/plot/plot_9.cpp"

===! "Plot"

example_plot_10

=== "C++"

--8<--"examples/line_plot/plot/plot_10.cpp"

===! "Plot"

example_plot_11

=== "C++"

--8<--"examples/line_plot/plot/plot_11.cpp"

===! "Plot"

example_plot_12

=== "C++"

--8<--"examples/line_plot/plot/plot_12.cpp"

Line Plot 3D

plot3(x,y);

=== "Plot"

example_plot3_1

=== "C++"

--8<--"examples/line_plot/plot3/plot3_1.cpp"

!!! tipWith method chaining:

plot3(x,y)->line_width(2).color("red");
More examples

example_plot3_2example_plot3_3example_plot3_4example_plot3_5example_plot3_7example_plot3_8example_plot3_9example_plot3_10

More Examples:

===! "Plot"

example_plot3_2

=== "C++"

--8<--"examples/line_plot/plot3/plot3_2.cpp"

===! "Plot"

example_plot3_3

=== "C++"

--8<--"examples/line_plot/plot3/plot3_3.cpp"

===! "Plot"

example_plot3_4

=== "C++"

--8<--"examples/line_plot/plot3/plot3_4.cpp"

===! "Plot"

example_plot3_5

=== "C++"

--8<--"examples/line_plot/plot3/plot3_5.cpp"

===! "Plot"

example_plot3_7

=== "C++"

--8<--"examples/line_plot/plot3/plot3_7.cpp"

===! "Plot"

example_plot3_8

=== "C++"

--8<--"examples/line_plot/plot3/plot3_8.cpp"

===! "Plot"

example_plot3_9

=== "C++"

--8<--"examples/line_plot/plot3/plot3_9.cpp"

===! "Plot"

example_plot3_10

=== "C++"

--8<--"examples/line_plot/plot3/plot3_10.cpp"

Stairs

stairs(x,y);

Thestair object renders the line with stairs between data points to denote discrete data.

See result

example_stairs_1

More Examples:

example_stairs_2example_stairs_3example_stairs_4example_stairs_5example_stairs_6example_stairs_7example_stairs_8example_stairs_9example_stairs_10

===! "Plot"

example_stairs_2

=== "C++"

--8<--"examples/line_plot/stairs/stairs_2.cpp"

More Examples:

===! "Plot"

example_stairs_3

=== "C++"

--8<--"examples/line_plot/stairs/stairs_3.cpp"

===! "Plot"

example_stairs_4

=== "C++"

--8<--"examples/line_plot/stairs/stairs_4.cpp"

===! "Plot"

example_stairs_5

=== "C++"

--8<--"examples/line_plot/stairs/stairs_5.cpp"

===! "Plot"

example_stairs_6

=== "C++"

--8<--"examples/line_plot/stairs/stairs_6.cpp"

===! "Plot"

example_stairs_7

=== "C++"

--8<--"examples/line_plot/stairs/stairs_7.cpp"

===! "Plot"

example_stairs_8

=== "C++"

--8<--"examples/line_plot/stairs/stairs_8.cpp"

===! "Plot"

example_stairs_9

=== "C++"

--8<--"examples/line_plot/stairs/stairs_9.cpp"

===! "Plot"

example_stairs_10

=== "C++"

--8<--"examples/line_plot/stairs/stairs_10.cpp"

Error Bars

errorbar(x,y,err);
See result

example_errorbar_1

More Examples:

example_errorbar_2example_errorbar_3example_errorbar_4example_errorbar_5example_errorbar_6example_errorbar_7example_errorbar_8example_errorbar_9example_errorbar_10

===! "Plot"

example_errorbar_1

=== "C++"

--8<--"examples/line_plot/errorbar/errorbar_1.cpp"

More Examples:

===! "Plot"

example_errorbar_2

=== "C++"

--8<--"examples/line_plot/errorbar/errorbar_2.cpp"

===! "Plot"

example_errorbar_3

=== "C++"

--8<--"examples/line_plot/errorbar/errorbar_3.cpp"

===! "Plot"

example_errorbar_4

=== "C++"

--8<--"examples/line_plot/errorbar/errorbar_4.cpp"

===! "Plot"

example_errorbar_5

=== "C++"

--8<--"examples/line_plot/errorbar/errorbar_5.cpp"

===! "Plot"

example_errorbar_6

=== "C++"

--8<--"examples/line_plot/errorbar/errorbar_6.cpp"

===! "Plot"

example_errorbar_7

=== "C++"

--8<--"examples/line_plot/errorbar/errorbar_7.cpp"

===! "Plot"

example_errorbar_8

=== "C++"

--8<--"examples/line_plot/errorbar/errorbar_8.cpp"

===! "Plot"

example_errorbar_9

=== "C++"

--8<--"examples/line_plot/errorbar/errorbar_9.cpp"

===! "Plot"

example_errorbar_10

=== "C++"

--8<--"examples/line_plot/errorbar/errorbar_10.cpp"

Theerror bar object includes extra lines to represent error around data points. Log plots are utility functions that adjust the x or y axes to a logarithmic scale.

Area

area(Y);
See result

example_area_1

More Examples:

example_area_2example_area_3example_area_4

===! "Plot"

example_area_1

=== "C++"

--8<--"examples/line_plot/area/area_1.cpp"

More Examples:

===! "Plot"

example_area_2

=== "C++"

--8<--"examples/line_plot/area/area_2.cpp"

===! "Plot"

example_area_3

=== "C++"

--8<--"examples/line_plot/area/area_3.cpp"

===! "Plot"

example_area_4

=== "C++"

--8<--"examples/line_plot/area/area_4.cpp"

Loglog Plot

loglog(x,y);
See result

example_loglog_1

More Examples:

example_loglog_2example_loglog_3example_loglog_4example_loglog_5example_loglog_6example_loglog_7example_loglog_8example_loglog_9

===! "Plot"

example_loglog_1

=== "C++"

--8<--"examples/line_plot/loglog/loglog_1.cpp"

More Examples:

===! "Plot"

example_loglog_2

=== "C++"

--8<--"examples/line_plot/loglog/loglog_2.cpp"

===! "Plot"

example_loglog_3

=== "C++"

--8<--"examples/line_plot/loglog/loglog_3.cpp"

===! "Plot"

example_loglog_4

=== "C++"

--8<--"examples/line_plot/loglog/loglog_4.cpp"

===! "Plot"

example_loglog_5

=== "C++"

--8<--"examples/line_plot/loglog/loglog_5.cpp"

===! "Plot"

example_loglog_6

=== "C++"

--8<--"examples/line_plot/loglog/loglog_6.cpp"

===! "Plot"

example_loglog_7

=== "C++"

--8<--"examples/line_plot/loglog/loglog_7.cpp"

===! "Plot"

example_loglog_8

=== "C++"

--8<--"examples/line_plot/loglog/loglog_8.cpp"

===! "Plot"

example_loglog_9

=== "C++"

--8<--"examples/line_plot/loglog/loglog_9.cpp"

Semilogx Plot

semilogx(x,y);
See result

example_semilogx_1

===! "Plot"

example_semilogx_1

=== "C++"

```cpp--8<-- "examples/line_plot/semilogx/semilogx_1.cpp"```

Semilogy Plot

semilogy(x,y);
See result

example_semilogy_1

===! "Plot"

example_semilogy_1

=== "C++"

--8<--"examples/line_plot/semilogy/semilogy_1.cpp"

Function Plot

fplot(fx);
See result

example_fplot_1

More Examples:

example_fplot_2example_fplot_3example_fplot_4example_fplot_5example_fplot_6

===! "Plot"

example_fplot_1

=== "C++"

--8<--"examples/line_plot/fplot/fplot_1.cpp"

More Examples:

===! "Plot"

example_fplot_2

=== "C++"

--8<--"examples/line_plot/fplot/fplot_2.cpp"

===! "Plot"

example_fplot_3

=== "C++"

--8<--"examples/line_plot/fplot/fplot_3.cpp"

===! "Plot"

example_fplot_4

=== "C++"

--8<--"examples/line_plot/fplot/fplot_4.cpp"

===! "Plot"

example_fplot_5

=== "C++"

```cpp--8<-- "examples/line_plot/fplot/fplot_5.cpp"```

===! "Plot"

example_fplot_6

=== "C++"

```cpp--8<-- "examples/line_plot/fplot/fplot_6.cpp"```

Instead of storing data points, the objectsfunction line andstring function store a function as a lambda function or as a string with an expression. These objects use lazy evaluation to generate absolute data points. The data is generated only when thedraw function is called.

Function Plot 3D

fplot(fxy);
See result

example_fplot3_1

More Examples:

example_fplot3_2example_fplot3_3example_fplot3_4example_fplot3_5

===! "Plot"

example_fplot3_1

=== "C++"

```cpp--8<-- "examples/line_plot/fplot3/fplot3_1.cpp"`````

More Examples:

===! "Plot"

example_fplot3_2

=== "C++"

```cpp--8<-- "examples/line_plot/fplot3/fplot3_2.cpp"```

===! "Plot"

example_fplot3_3

=== "C++"

```cpp--8<-- "examples/line_plot/fplot3/fplot3_3.cpp"```

===! "Plot"

example_fplot3_4

=== "C++"

```cpp--8<-- "examples/line_plot/fplot3/fplot3_4.cpp"```

===! "Plot"

example_fplot3_5

=== "C++"

```cpp--8<-- "examples/line_plot/fplot3/fplot3_5.cpp"```

Implicit function

fplot(fxy);
See result

example_fimplicit_1

More Examples:

example_fimplicit_2example_fimplicit_3example_fimplicit_4

===! "Plot"

example_fimplicit_1

=== "C++"

```cpp--8<-- "examples/line_plot/fimplicit/fimplicit_1.cpp"```

More Examples:

===! "Plot"

example_fimplicit_2

=== "C++"

```cpp--8<-- "examples/line_plot/fimplicit/fimplicit_2.cpp"```

===! "Plot"

example_fimplicit_3

=== "C++"

```cpp--8<-- "examples/line_plot/fimplicit/fimplicit_3.cpp"```

===! "Plot"

example_fimplicit_4

=== "C++"

```cpp--8<-- "examples/line_plot/fimplicit/fimplicit_4.cpp"```

Data Distribution

Histogram |Boxplot |Scatter Plot |Scatter Plot 3D |Binned Scatter Plots |Plot Matrix |Parallel Coordinates |Pie Chart |Heatmap |Word Cloud

Histogram

Thehistogram object creates the histogram edges and bins when thedraw function is called for the first time with lazy evaluation. Lazy evaluation avoids calculating edges unnecessarily in case the user changes the object parameters before callingdraw. This object includes several algorithms for automatically delimiting the edges and bins for the histograms.

hist(data);
See result

example_histogram_1

More Examples:

example_histogram_2example_histogram_3example_histogram_4example_histogram_5example_histogram_6example_histogram_7example_histogram_8example_histogram_9example_histogram_10example_histogram_11example_histogram_12example_histogram_14

===! "Plot"

example_histogram_1

=== "C++"

```cpp--8<-- "examples/data_distribution/histogram/histogram_1.cpp"```

More Examples:

===! "Plot"

example_histogram_2

=== "C++"

```cpp--8<-- "examples/data_distribution/histogram/histogram_2.cpp"```

===! "Plot"

example_histogram_3

=== "C++"

```cpp--8<-- "examples/data_distribution/histogram/histogram_3.cpp"```

===! "Plot"

example_histogram_4

=== "C++"

```cpp--8<-- "examples/data_distribution/histogram/histogram_4.cpp"```

===! "Plot"

example_histogram_5

=== "C++"

```cpp--8<-- "examples/data_distribution/histogram/histogram_5.cpp"```

===! "Plot"

example_histogram_6

=== "C++"

```cpp--8<-- "examples/data_distribution/histogram/histogram_6.cpp"```

===! "Plot"

example_histogram_7

=== "C++"

```cpp--8<-- "examples/data_distribution/histogram/histogram_7.cpp"```

===! "Plot"

example_histogram_8

=== "C++"

```cpp--8<-- "examples/data_distribution/histogram/histogram_8.cpp"```

===! "Plot"

example_histogram_9

=== "C++"

```cpp--8<-- "examples/data_distribution/histogram/histogram_9.cpp"```

===! "Plot"

example_histogram_10

=== "C++"

```cpp--8<-- "examples/data_distribution/histogram/histogram_10.cpp"```

===! "Plot"

example_histogram_11

=== "C++"

```cpp--8<-- "examples/data_distribution/histogram/histogram_11.cpp"```

===! "Plot"

example_histogram_12

=== "C++"

```cpp--8<-- "examples/data_distribution/histogram/histogram_12.cpp"```

===! "Plot"

example_histogram_14

=== "C++"

```cpp--8<-- "examples/data_distribution/histogram/histogram_14.cpp"```

Boxplot

boxplot(data);
See result

example_boxplot_1

More Examples:

example_boxplot_2example_boxplot_3

===! "Plot"

example_boxplot_1

=== "C++"

```cpp--8<-- "examples/data_distribution/boxplot/boxplot_1.cpp"```

More Examples:

===! "Plot"

example_boxplot_2

=== "C++"

```cpp--8<-- "examples/data_distribution/boxplot/boxplot_2.cpp"```

===! "Plot"

example_boxplot_3

=== "C++"

```cpp--8<-- "examples/data_distribution/boxplot/boxplot_3.cpp"```

Scatter Plot

scatter(x,y);
See result

example_scatter_1

More Examples:

example_scatter_2example_scatter_3example_scatter_4example_scatter_5example_scatter_6example_scatter_7example_scatter_8

===! "Plot"

example_scatter_1

=== "C++"

```cpp--8<-- "examples/data_distribution/scatter/scatter_1.cpp"```

More Examples:

===! "Plot"

example_scatter_2

=== "C++"

```cpp--8<-- "examples/data_distribution/scatter/scatter_2.cpp"```

===! "Plot"

example_scatter_3

=== "C++"

```cpp--8<-- "examples/data_distribution/scatter/scatter_3.cpp"```

===! "Plot"

example_scatter_4

=== "C++"

```cpp--8<-- "examples/data_distribution/scatter/scatter_4.cpp"```

===! "Plot"

example_scatter_5

=== "C++"

```cpp--8<-- "examples/data_distribution/scatter/scatter_5.cpp"```

===! "Plot"

example_scatter_6

=== "C++"

```cpp--8<-- "examples/data_distribution/scatter/scatter_6.cpp"```

===! "Plot"

example_scatter_7

=== "C++"

```cpp--8<-- "examples/data_distribution/scatter/scatter_7.cpp"```

===! "Plot"

example_scatter_8

=== "C++"

```cpp--8<-- "examples/data_distribution/scatter/scatter_8.cpp"```

Scatter plots also depend on theline object. As the line object can represent lines with markers, thescatter function simply creates markers without the lines.

Scatter Plot 3D

scatter(x,y,z);
See result

example_scatter3_1

More Examples:

example_scatter3_2example_scatter3_3example_scatter3_4example_scatter3_5example_scatter3_6

===! "Plot"

example_scatter3_1

=== "C++"

```cpp--8<-- "examples/data_distribution/scatter3/scatter3_1.cpp"```

More Examples:

===! "Plot"

example_scatter3_2

=== "C++"

```cpp--8<-- "examples/data_distribution/scatter3/scatter3_2.cpp"```

===! "Plot"

example_scatter3_3

=== "C++"

```cpp--8<-- "examples/data_distribution/scatter3/scatter3_3.cpp"```

===! "Plot"

example_scatter3_4

=== "C++"

```cpp--8<-- "examples/data_distribution/scatter3/scatter3_4.cpp"```

===! "Plot"

example_scatter3_5

=== "C++"

```cpp--8<-- "examples/data_distribution/scatter3/scatter3_5.cpp"```

===! "Plot"

example_scatter3_6

=== "C++"

```cpp--8<-- "examples/data_distribution/scatter3/scatter3_6.cpp"```

Binned Scatter Plots

binscatter(x,y);
See result

example_binscatter_1

More Examples:

example_binscatter_2example_binscatter_3example_binscatter_4example_binscatter_5example_binscatter_6example_binscatter_7

===! "Plot"

example_binscatter_1

=== "C++"

```cpp--8<-- "examples/data_distribution/binscatter/binscatter_1.cpp"```

More Examples:

===! "Plot"

example_binscatter_2

=== "C++"

```cpp--8<-- "examples/data_distribution/binscatter/binscatter_2.cpp"```

===! "Plot"

example_binscatter_3

=== "C++"

```cpp--8<-- "examples/data_distribution/binscatter/binscatter_3.cpp"```

===! "Plot"

example_binscatter_4

=== "C++"

```cpp--8<-- "examples/data_distribution/binscatter/binscatter_4.cpp"```

===! "Plot"

example_binscatter_5

=== "C++"

```cpp--8<-- "examples/data_distribution/binscatter/binscatter_5.cpp"```

===! "Plot"

example_binscatter_6

=== "C++"

```cpp--8<-- "examples/data_distribution/binscatter/binscatter_6.cpp"```

===! "Plot"

example_binscatter_7

=== "C++"

```cpp--8<-- "examples/data_distribution/binscatter/binscatter_7.cpp"```

Binned scatter plots use variations of the histogram algorithms of the previous section as an extra step to place all the data into two-dimensional bins that can be represented with varying colors or sizes. This is useful when there are so many data points that a scatter plot would be impractical for visualizing the data.

Plot Matrix

plotmatrix(X);
See result

example_plotmatrix_1

More Examples:

example_plotmatrix_2example_plotmatrix_3example_plotmatrix_4

===! "Plot"

example_plotmatrix_1

=== "C++"

```cpp--8<-- "examples/data_distribution/plotmatrix/plotmatrix_1.cpp"```

More Examples:

===! "Plot"

example_plotmatrix_2

=== "C++"

```cpp--8<-- "examples/data_distribution/plotmatrix/plotmatrix_2.cpp"```

===! "Plot"

example_plotmatrix_3

=== "C++"

```cpp--8<-- "examples/data_distribution/plotmatrix/plotmatrix_3.cpp"```

===! "Plot"

example_plotmatrix_4

=== "C++"

```cpp--8<-- "examples/data_distribution/plotmatrix/plotmatrix_4.cpp"```

The Plot Matrix subcategory is a combination of histograms and scatter plots. It creates a matrix ofaxes objects on thefigure and creates a scatter plot for each pair of data sets.

Parallel Coordinates

parallelplot(X);
See result

example_parallelplot_1

More Examples:

example_parallelplot_2example_parallelplot_3

===! "Plot"

example_parallelplot_1

=== "C++"

```cpp--8<-- "examples/data_distribution/parallelplot/parallelplot_1.cpp"```

More Examples:

===! "Plot"

example_parallelplot_2

=== "C++"

```cpp--8<-- "examples/data_distribution/parallelplot/parallelplot_2.cpp"```

===! "Plot"

example_parallelplot_3

=== "C++"

```cpp--8<-- "examples/data_distribution/parallelplot/parallelplot_3.cpp"```

The functionparallelplot creates a plot with Parallel Coordinates. In this type of plot, aparallel lines object stores an arbitrary set ofaxis objects to represent multi-dimensional data.

Pie Chart

pie(x);
See result

example_pie_1

More Examples:

example_pie_2example_pie_3example_pie_4example_pie_5example_pie_6

===! "Plot"

example_pie_1

=== "C++"

```cpp--8<-- "examples/data_distribution/pie/pie_1.cpp"```

More Examples:

===! "Plot"

example_pie_2

=== "C++"

```cpp--8<-- "examples/data_distribution/pie/pie_2.cpp"```

===! "Plot"

example_pie_3

=== "C++"

```cpp--8<-- "examples/data_distribution/pie/pie_3.cpp"```

===! "Plot"

example_pie_4

=== "C++"

```cpp--8<-- "examples/data_distribution/pie/pie_4.cpp"```

===! "Plot"

example_pie_5

=== "C++"

```cpp--8<-- "examples/data_distribution/pie/pie_5.cpp"```

===! "Plot"

example_pie_6

=== "C++"

```cpp--8<-- "examples/data_distribution/pie/pie_6.cpp"```

Heatmap

heatmap(data);
See result

example_heatmap_1

More Examples:

example_heatmap_2example_heatmap_3example_heatmap_4example_heatmap_5example_heatmap_6example_heatmap_7

===! "Plot"

example_heatmap_1

=== "C++"

```cpp--8<-- "examples/data_distribution/heatmap/heatmap_1.cpp"```

More Examples:

===! "Plot"

example_heatmap_2

=== "C++"

```cpp--8<-- "examples/data_distribution/heatmap/heatmap_2.cpp"```

===! "Plot"

example_heatmap_3

=== "C++"

```cpp--8<-- "examples/data_distribution/heatmap/heatmap_3.cpp"```

===! "Plot"

example_heatmap_4

=== "C++"

```cpp--8<-- "examples/data_distribution/heatmap/heatmap_4.cpp"```

===! "Plot"

example_heatmap_5

=== "C++"

```cpp--8<-- "examples/data_distribution/heatmap/heatmap_5.cpp"```

===! "Plot"

example_heatmap_6

=== "C++"

```cpp--8<-- "examples/data_distribution/heatmap/heatmap_6.cpp"```

===! "Plot"

example_heatmap_7

=== "C++"

```cpp--8<-- "examples/data_distribution/heatmap/heatmap_7.cpp"```

Word Cloud

wordcloud(text, black_list);
See result

example_wordcloud_1

More Examples:

example_wordcloud_3example_wordcloud_4example_wordcloud_4

===! "Plot"

example_wordcloud_1

=== "C++"

```cpp--8<-- "examples/data_distribution/wordcloud/wordcloud_1.cpp"```

More Examples:

===! "Plot"

example_wordcloud_3

=== "C++"

```cpp--8<-- "examples/data_distribution/wordcloud/wordcloud_3.cpp"```

===! "Plot"

example_wordcloud_4

=== "C++"

```cpp--8<-- "examples/data_distribution/wordcloud/wordcloud_4.cpp"```

===! "Plot"

example_wordcloud_4

=== "C++"

```cpp--8<-- "examples/data_distribution/wordcloud/wordcloud_4.cpp"```

Word clouds are generated from text or pairs of words and their frequency. After attributing a size proportional to each word frequency, the algorithm to position the labels iterates words from the largest to the smallest. For each word, it spins the word in polar coordinates converted to Cartesian coordinates until it does not overlap with any other word.

By default, the colors and the sizes depend on the word frequencies. We can customize the colors by passing a third parameter to thewordcloud function.

Discrete Data

Bar Plot |Pareto Chart |Stem Plot |Stem Plot 3D

Bar Plot

bar(y);
See result

example_bar_1

More Examples:

example_bar_2example_bar_3example_bar_4example_bar_5example_bar_6example_bar_7example_bar_8example_bar_9example_bar_10example_bar_11example_bar_12example_bar_13

===! "Plot"

example_bar_1

=== "C++"

```cpp--8<-- "examples/discrete_data/bar/bar_1.cpp"```

More Examples:

===! "Plot"

example_bar_2

=== "C++"

```cpp--8<-- "examples/discrete_data/bar/bar_2.cpp"```

===! "Plot"

example_bar_3

=== "C++"

```cpp--8<-- "examples/discrete_data/bar/bar_3.cpp"```

===! "Plot"

example_bar_4

=== "C++"

```cpp--8<-- "examples/discrete_data/bar/bar_4.cpp"```

===! "Plot"

example_bar_5

=== "C++"

```cpp--8<-- "examples/discrete_data/bar/bar_5.cpp"```

===! "Plot"

example_bar_6

=== "C++"

```cpp--8<-- "examples/discrete_data/bar/bar_6.cpp"```

===! "Plot"

example_bar_7

=== "C++"

```cpp--8<-- "examples/discrete_data/bar/bar_7.cpp"```

===! "Plot"

example_bar_8

=== "C++"

```cpp--8<-- "examples/discrete_data/bar/bar_8.cpp"```

===! "Plot"

example_bar_9

=== "C++"

```cpp--8<-- "examples/discrete_data/bar/bar_9.cpp"```

===! "Plot"

example_bar_10

=== "C++"

```cpp--8<-- "examples/discrete_data/bar/bar_10.cpp"```

===! "Plot"

example_bar_11

=== "C++"

```cpp--8<-- "examples/discrete_data/bar/bar_11.cpp"```

===! "Plot"

example_bar_12

=== "C++"

```cpp--8<-- "examples/discrete_data/bar/bar_12.cpp"```

===! "Plot"

example_bar_13

=== "C++"

```cpp--8<-- "examples/discrete_data/bar/bar_13.cpp"```

Pareto Chart

pareto(y);
See result

example_pareto_1

More Examples:

example_pareto_2example_pareto_3example_pareto_4

===! "Plot"

example_pareto_1

=== "C++"

```cpp--8<-- "examples/discrete_data/pareto/pareto_1.cpp"```

More Examples:

===! "Plot"

example_pareto_2

=== "C++"

```cpp--8<-- "examples/discrete_data/pareto/pareto_2.cpp"```

===! "Plot"

example_pareto_3

=== "C++"

```cpp--8<-- "examples/discrete_data/pareto/pareto_3.cpp"```

===! "Plot"

example_pareto_4

=== "C++"

```cpp--8<-- "examples/discrete_data/pareto/pareto_4.cpp"```

Pareto Charts are a type of chart that uses both axes. The axis is used to represent bars with the data values in descending order. The axis is used to represent the cumulative distribution function of the data in the axis. By default, a Pareto Chart includes up to 10 items or as many items as needed to represent 95% of the cumulative distribution.

If you need Paretofronts rather than Paretocharts, we refer toScatter Plots for two-dimensional fronts,Plot matrices for three-dimensional fronts, orParallel Coordinate Plots for many-objective fronts. These plot subcategories are described in SectionData Distribution. If you also need a tool to calculate these fronts efficiently, we refer to thePareto Front Library.

Stem Plot

stem(Y);
See result

example_stem_1

More Examples:

example_stem_2example_stem_3example_stem_4example_stem_5example_stem_6example_stem_7example_stem_8example_stem_9

===! "Plot"

example_stem_1

=== "C++"

```cpp--8<-- "examples/discrete_data/stem/stem_1.cpp"```

More Examples:

===! "Plot"

example_stem_2

=== "C++"

```cpp--8<-- "examples/discrete_data/stem/stem_2.cpp"```

===! "Plot"

example_stem_3

=== "C++"

```cpp--8<-- "examples/discrete_data/stem/stem_3.cpp"```

===! "Plot"

example_stem_4

=== "C++"

```cpp--8<-- "examples/discrete_data/stem/stem_4.cpp"```

===! "Plot"

example_stem_5

=== "C++"

```cpp--8<-- "examples/discrete_data/stem/stem_5.cpp"```

===! "Plot"

example_stem_6

=== "C++"

```cpp--8<-- "examples/discrete_data/stem/stem_6.cpp"```

===! "Plot"

example_stem_7

=== "C++"

```cpp--8<-- "examples/discrete_data/stem/stem_7.cpp"```

===! "Plot"

example_stem_8

=== "C++"

```cpp--8<-- "examples/discrete_data/stem/stem_8.cpp"```

===! "Plot"

example_stem_9

=== "C++"

```cpp--8<-- "examples/discrete_data/stem/stem_9.cpp"```

Stem Plot 3D

stem3(z);
See result

example_stem3_1

More Examples:

example_stem3_2example_stem3_3example_stem3_4example_stem3_5example_stem3_6example_stem3_7example_stem3_8example_stem3_9example_stem3_10example_stem3_11

===! "Plot"

example_stem3_1

=== "C++"

```cpp--8<-- "examples/discrete_data/stem3/stem3_1.cpp"```

More Examples:

===! "Plot"

example_stem3_2

=== "C++"

```cpp--8<-- "examples/discrete_data/stem3/stem3_2.cpp"```

===! "Plot"

example_stem3_3

=== "C++"

```cpp--8<-- "examples/discrete_data/stem3/stem3_3.cpp"```

===! "Plot"

example_stem3_4

=== "C++"

```cpp--8<-- "examples/discrete_data/stem3/stem3_4.cpp"```

===! "Plot"

example_stem3_5

=== "C++"

```cpp--8<-- "examples/discrete_data/stem3/stem3_5.cpp"```

===! "Plot"

example_stem3_6

=== "C++"

```cpp--8<-- "examples/discrete_data/stem3/stem3_6.cpp"```

===! "Plot"

example_stem3_7

=== "C++"

```cpp--8<-- "examples/discrete_data/stem3/stem3_7.cpp"```

===! "Plot"

example_stem3_8

=== "C++"

```cpp--8<-- "examples/discrete_data/stem3/stem3_8.cpp"```

===! "Plot"

example_stem3_9

=== "C++"

```cpp--8<-- "examples/discrete_data/stem3/stem3_9.cpp"```

===! "Plot"

example_stem3_10

=== "C++"

```cpp--8<-- "examples/discrete_data/stem3/stem3_10.cpp"```

===! "Plot"

example_stem3_11

=== "C++"

```cpp--8<-- "examples/discrete_data/stem3/stem3_11.cpp"```

Geography

Geoplot |Geoscatter Plot |Geobubble |Geodensity Plot

Geoplot

geoplot(lat,lon);
See result

example_geoplot_1

More Examples:

example_geoplot_2example_geoplot_3example_geoplot_4example_geoplot_5example_geoplot_6example_geoplot_7

===! "Plot"

example_geoplot_1

=== "C++"

```cpp--8<-- "examples/geography/geoplot/geoplot_1.cpp"```

More Examples:

===! "Plot"

example_geoplot_2

=== "C++"

```cpp--8<-- "examples/geography/geoplot/geoplot_2.cpp"```

===! "Plot"

example_geoplot_3

=== "C++"

```cpp--8<-- "examples/geography/geoplot/geoplot_3.cpp"```

===! "Plot"

example_geoplot_4

=== "C++"

```cpp--8<-- "examples/geography/geoplot/geoplot_4.cpp"```

===! "Plot"

example_geoplot_5

=== "C++"

```cpp--8<-- "examples/geography/geoplot/geoplot_5.cpp"```

===! "Plot"

example_geoplot_6

=== "C++"

```cpp--8<-- "examples/geography/geoplot/geoplot_6.cpp"```

===! "Plot"

example_geoplot_7

=== "C++"

```cpp--8<-- "examples/geography/geoplot/geoplot_7.cpp"```

For the first geography plot,Matplot++ callsgeoplot(), which creates a filled polygon with the world map. This first plot receives the tag"map" so that subsequent geography plots recognize there is no need to recreate this world map.

The data for the world map comes fromNatural Earth. They provide data at 1:10m, 1:50m, and 1:110m scales. Thegeoplot function will initially use the data at the 1:110m scales. Thegeolimits function can be used to update the axis limits for geography plots. The difference between the usual functions for adjusting axis limits (xlim andylim) andgeolimits is that the latter will also update the map resolution according to the new limits for the and axis.

Thegeolimits function will query thefigure size and, depending on the new limits for the axes, update the map to the 1:10m, or 1:50m scales if needed. Because it would be very inefficient to render the whole world map at a 1:10m or 1:50m scale only to display a region of this map, thegeolimits function also crops the data pertinent to the new region being displayed.

Note that this does not only involve removing data points outside the new limits but it also needs to create new data points on the correct borders to create new polygons coherent with the map entry points in the region. For this reason, the algorithm needs to track all submaps represented as closed polygons in the original world map. If submaps are completely inside or outside the new ranges, we can respectively include or dismiss the data points. However, if the submap is only partially inside the new limits, to generate the correct borders for the polygons, we need to track all points outside the limits to classify the directions of these points outside the limits. We do that by only including points that change quadrants around the new limits so that the map entry points create polygons that look like they would if the complete world map were still being rendered outside these new limits.

If the you are not interested in geographic plots, the build script includes an option to remove the high-resolution maps at 1:10m and 1:50m scales from the library. In this case, the library will always use the map at a 1:110m scale no matter the axis limits.

The functionworld_cities returns a list of major world cities. Its parameters define the minimum distances between cities in the and axes. Thegreedy_tsp function is a naive greedy algorithm to find a route between these cities as a Traveling Salesman Problem (TSP). We use thegeoplot function to draw this route. Note that we use method chaining to define some further plot properties. Finally, thetext function includes the city names in the map.

Geoscatter Plot

geoscatter(lat,lon);
See result

example_geoscatter_1

More Examples:

example_geoscatter_2

===! "Plot"

example_geoscatter_1

=== "C++"

```cpp--8<-- "examples/geography/geoscatter/geoscatter_1.cpp"```

More Examples:

===! "Plot"

example_geoscatter_2

=== "C++"

```cpp--8<-- "examples/geography/geoscatter/geoscatter_2.cpp"```

Geobubble

geobubble(lat,lon,sizes);
See result

example_geobubble_1

More Examples:

example_geobubble_2

===! "Plot"

example_geobubble_1

=== "C++"

```cpp--8<-- "examples/geography/geobubble/geobubble_1.cpp"```

More Examples:

===! "Plot"

example_geobubble_2

=== "C++"

```cpp--8<-- "examples/geography/geobubble/geobubble_2.cpp"```

Geodensity Plot

geodensityplot(lat, lon);
See result

example_geodensityplot_1

=== "Plot"

example_geodensityplot_1

=== "C++"

```cpp--8<-- "examples/geography/geodensityplot/geodensityplot_1.cpp"```

Polar Plots

Polar Line Plot |Polar Scatter Plot |Polar Histogram |Compass |Polar Function

Polar Line Plot

polarplot(theta, rho);
See result

example_polarplot_1

More Examples:

example_polarplot_2example_polarplot_3example_polarplot_4example_polarplot_5example_polarplot_6example_polarplot_7example_polarplot_8

===! "Plot"

example_polarplot_1

=== "C++"

```cpp--8<-- "examples/polar_plots/polarplot/polarplot_1.cpp"```

More Examples:

===! "Plot"

example_polarplot_2

=== "C++"

```cpp--8<-- "examples/polar_plots/polarplot/polarplot_2.cpp"```

===! "Plot"

example_polarplot_3

=== "C++"

```cpp--8<-- "examples/polar_plots/polarplot/polarplot_3.cpp"```

===! "Plot"

example_polarplot_4

=== "C++"

```cpp--8<-- "examples/polar_plots/polarplot/polarplot_4.cpp"```

===! "Plot"

example_polarplot_5

=== "C++"

```cpp--8<-- "examples/polar_plots/polarplot/polarplot_5.cpp"```

===! "Plot"

example_polarplot_6

=== "C++"

```cpp--8<-- "examples/polar_plots/polarplot/polarplot_6.cpp"```

===! "Plot"

example_polarplot_7

=== "C++"

```cpp--8<-- "examples/polar_plots/polarplot/polarplot_7.cpp"```

===! "Plot"

example_polarplot_8

=== "C++"

```cpp--8<-- "examples/polar_plots/polarplot/polarplot_8.cpp"```

By emplacing a polar plot in theaxes, theaxes move to a polar mode, where we use the and axis instead of the and axis.

From the backend point of view, these axes are an abstraction to the user. The data points in the and axis are drawn by converting the positions from the polar coordinates and to the Cartesian coordinates and with the relationships and.

Aside from this conversion, these plot subcategories are analogous to line plots, scatter plots, histograms, quiver plots, and line functions.

Polar Scatter Plot

polarscatter(theta, rho);
See result

example_polarscatter_1

More Examples:

example_polarscatter_2example_polarscatter_3example_polarscatter_4example_polarscatter_5example_polarscatter_6

===! "Plot"

example_polarscatter_1

=== "C++"

```cpp--8<-- "examples/polar_plots/polarscatter/polarscatter_1.cpp"```

More Examples:

===! "Plot"

example_polarscatter_2

=== "C++"

```cpp--8<-- "examples/polar_plots/polarscatter/polarscatter_2.cpp"```

===! "Plot"

example_polarscatter_3

=== "C++"

```cpp--8<-- "examples/polar_plots/polarscatter/polarscatter_3.cpp"```

===! "Plot"

example_polarscatter_4

=== "C++"

```cpp--8<-- "examples/polar_plots/polarscatter/polarscatter_4.cpp"```

===! "Plot"

example_polarscatter_5

=== "C++"

```cpp--8<-- "examples/polar_plots/polarscatter/polarscatter_5.cpp"```

===! "Plot"

example_polarscatter_6

=== "C++"

```cpp--8<-- "examples/polar_plots/polarscatter/polarscatter_6.cpp"```

Polar Histogram

polarhistogram(theta,6);
See result

example_polarhistogram_1

More Examples:

example_polarhistogram_2example_polarhistogram_3example_polarhistogram_4example_polarhistogram_5

===! "Plot"

example_polarhistogram_1

=== "C++"

```cpp--8<-- "examples/polar_plots/polarhistogram/polarhistogram_1.cpp"```

More Examples:

===! "Plot"

example_polarhistogram_2

=== "C++"

```cpp--8<-- "examples/polar_plots/polarhistogram/polarhistogram_2.cpp"```

===! "Plot"

example_polarhistogram_3

=== "C++"

```cpp--8<-- "examples/polar_plots/polarhistogram/polarhistogram_3.cpp"```

===! "Plot"

example_polarhistogram_4

=== "C++"

```cpp--8<-- "examples/polar_plots/polarhistogram/polarhistogram_4.cpp"```

===! "Plot"

example_polarhistogram_5

=== "C++"

```cpp--8<-- "examples/polar_plots/polarhistogram/polarhistogram_5.cpp"```

The functionpolarhistogram distributes the data into the number of bins provided as its second parameter.

Compass

compass(u, v);
See result

example_compass_1

More Examples:

example_compass_2

===! "Plot"

example_compass_1

=== "C++"

```cpp--8<-- "examples/polar_plots/compass/compass_1.cpp"```

More Examples:

===! "Plot"

example_compass_2

=== "C++"

```cpp--8<-- "examples/polar_plots/compass/compass_2.cpp"```

Polar Function

ezpolar(fn);
See result

example_ezpolar_1

More Examples:

example_ezpolar_2

===! "Plot"

example_ezpolar_1

=== "C++"

```cpp--8<-- "examples/polar_plots/ezpolar/ezpolar_1.cpp"```

More Examples:

===! "Plot"

example_ezpolar_2

=== "C++"

```cpp--8<-- "examples/polar_plots/ezpolar/ezpolar_2.cpp"```

Contour Plots

Contour |Filled Contour |Function Contour

Contour

contour(X, Y, Z);
See result

example_contour_1

More Examples:

example_contour_2example_contour_3example_contour_4example_contour_5example_contour_6example_contour_7example_contour_8

===! "Plot"

example_contour_1

=== "C++"

```cpp--8<-- "examples/contour_plots/contour/contour_1.cpp"```

More Examples:

===! "Plot"

example_contour_2

=== "C++"

```cpp--8<-- "examples/contour_plots/contour/contour_2.cpp"```

===! "Plot"

example_contour_3

=== "C++"

```cpp--8<-- "examples/contour_plots/contour/contour_3.cpp"```

===! "Plot"

example_contour_4

=== "C++"

```cpp--8<-- "examples/contour_plots/contour/contour_4.cpp"```

===! "Plot"

example_contour_5

=== "C++"

```cpp--8<-- "examples/contour_plots/contour/contour_5.cpp"```

===! "Plot"

example_contour_6

=== "C++"

```cpp--8<-- "examples/contour_plots/contour/contour_6.cpp"```

===! "Plot"

example_contour_7

=== "C++"

```cpp--8<-- "examples/contour_plots/contour/contour_7.cpp"```

===! "Plot"

example_contour_8

=== "C++"

```cpp--8<-- "examples/contour_plots/contour/contour_8.cpp"```

All these subcategories depend on thecontours type. They also depend on lazy evaluation for generating the contour lines. When the functiondraw is called in thecontours class, it preprocesses all contour lines for a three-dimensional function.

Although it is relatively simple to show a heatmap with the values for the-axis, calculating contour lines relative to the-axis is more complex than it might seem at first. We provide the functioncontourc for calculating contour lines. This function uses an adaptation of the algorithm adopted by Matplotlib.

The algorithm creates a quad grid defined by the and values. It uses this grid to infer a contour line passing through positions with the same value. The algorithm sweeps through the grid twice to generate these lines. The first sweep looks for lines that start on the boundaries. The second sweep looks for interior closed loops.

Filled contours are closed polygons for pairs of contour levels. Some polygons for filled contours might be holes inside other polygons. The algorithm needs to keep track of these relationships so that we can render the polygons in their accurate order. To avoid an extra step that identifies this relationship between the polygons, the sweeping algorithm already identifies which polygons are holes for each level.

Once we find the quads with the contour line, the line is generated by interpolating the values around that quad.

Filled Contour

contourf(X, Y, Z);
See result

example_contourf_1

More Examples:

example_contourf_2example_contourf_3example_contourf_4example_contourf_5example_contourf_6

===! "Plot"

example_contourf_1

=== "C++"

```cpp--8<-- "examples/contour_plots/contourf/contourf_1.cpp"```

More Examples:

===! "Plot"

example_contourf_2

=== "C++"

```cpp--8<-- "examples/contour_plots/contourf/contourf_2.cpp"```

===! "Plot"

example_contourf_3

=== "C++"

```cpp--8<-- "examples/contour_plots/contourf/contourf_3.cpp"```

===! "Plot"

example_contourf_4

=== "C++"

```cpp--8<-- "examples/contour_plots/contourf/contourf_4.cpp"```

===! "Plot"

example_contourf_5

=== "C++"

```cpp--8<-- "examples/contour_plots/contourf/contourf_5.cpp"```

===! "Plot"

example_contourf_6

=== "C++"

```cpp--8<-- "examples/contour_plots/contourf/contourf_6.cpp"```

Function Contour

fcontour(f);
See result

example_fcontour_1

More Examples:

example_fcontour_2example_fcontour_3example_fcontour_4example_fcontour_5example_fcontour_6example_fcontour_7example_fcontour_8example_fcontour_9example_fcontour_10example_fcontour_11

===! "Plot"

example_fcontour_1

=== "C++"

```cpp--8<-- "examples/contour_plots/fcontour/fcontour_1.cpp"```

More Examples:

===! "Plot"

example_fcontour_2

=== "C++"

```cpp--8<-- "examples/contour_plots/fcontour/fcontour_2.cpp"```

===! "Plot"

example_fcontour_3

=== "C++"

```cpp--8<-- "examples/contour_plots/fcontour/fcontour_3.cpp"```

===! "Plot"

example_fcontour_4

=== "C++"

```cpp--8<-- "examples/contour_plots/fcontour/fcontour_4.cpp"```

===! "Plot"

example_fcontour_5

=== "C++"

```cpp--8<-- "examples/contour_plots/fcontour/fcontour_5.cpp"```

===! "Plot"

example_fcontour_6

=== "C++"

```cpp--8<-- "examples/contour_plots/fcontour/fcontour_6.cpp"```

===! "Plot"

example_fcontour_7

=== "C++"

```cpp--8<-- "examples/contour_plots/fcontour/fcontour_7.cpp"```

===! "Plot"

example_fcontour_8

=== "C++"

```cpp--8<-- "examples/contour_plots/fcontour/fcontour_8.cpp"```

===! "Plot"

example_fcontour_9

=== "C++"

```cpp--8<-- "examples/contour_plots/fcontour/fcontour_9.cpp"```

===! "Plot"

example_fcontour_10

=== "C++"

```cpp--8<-- "examples/contour_plots/fcontour/fcontour_10.cpp"```

===! "Plot"

example_fcontour_11

=== "C++"

```cpp--8<-- "examples/contour_plots/fcontour/fcontour_11.cpp"```

By default, the functionfcontour will generate 9 contour lines from a lambda function. The functionscontour andcontourf, on the other hand, plot contour lines and filled contour lines from a grid of data points for,, and.

Vector Fields

Feather |Quiver |Quiver 3D

Quiver

quiver(x, y, u, v);
See result

example_quiver_1

More Examples:

example_quiver_2example_quiver_3example_quiver_4

===! "Plot"

example_quiver_1

=== "C++"

```cpp--8<-- "examples/vector_fields/quiver/quiver_1.cpp"```

More Examples:

===! "Plot"

example_quiver_2

=== "C++"

```cpp--8<-- "examples/vector_fields/quiver/quiver_2.cpp"```

===! "Plot"

example_quiver_3

=== "C++"

```cpp--8<-- "examples/vector_fields/quiver/quiver_3.cpp"```

===! "Plot"

example_quiver_4

=== "C++"

```cpp--8<-- "examples/vector_fields/quiver/quiver_4.cpp"```

===! "Plot"

example_quiver_6

=== "C++"

```cpp--8<-- "examples/vector_fields/quiver/quiver_6.cpp"```

All these subcategories depend on thevectors object type. In a two-dimensional plot, for each value of and with the position of a vector, it also requires the value of and indicating its direction and magnitude. In a three-dimensional plot, the direction and magnitude are defined by,, and.

A quiver plot (or velocity plot) shows a grid of vectors whose direction and magnitude are scaled to prevent the overlap between vectors in subsequent quads.

Quiver 3D

quiver3(Z, U, V, W);
See result

example_quiver3_1

===! "Plot"

example_quiver3_1

=== "C++"

```cpp--8<-- "examples/vector_fields/quiver3/quiver3_1.cpp"```

===! "Plot"

example_quiver3_2

=== "C++"

```cpp--8<-- "examples/vector_fields/quiver3/quiver3_2.cpp"```

Feather

feather(u, v);
See result

example_feather_1

===! "Plot"

example_feather_1

=== "C++"

```cpp--8<-- "examples/vector_fields/feather/feather_1.cpp"```

Surfaces

Surface |Surface with Contour |Mesh |Mesh with Contour |Mesh with Curtain |Function Surface |Function Mesh |Waterfall |Fence |Ribbon

Surface

surf(X, Y, Z);
See result

example_surf_1

More Examples:

example_surf_2example_surf_3example_surf_4example_surf_5example_surf_6

===! "Plot"

example_surf_1

=== "C++"

```cpp--8<-- "examples/surfaces/surf/surf_1.cpp"```

More Examples:

===! "Plot"

example_surf_2

=== "C++"

```cpp--8<-- "examples/surfaces/surf/surf_2.cpp"```

===! "Plot"

example_surf_3

=== "C++"

```cpp--8<-- "examples/surfaces/surf/surf_3.cpp"```

===! "Plot"

example_surf_4

=== "C++"

```cpp--8<-- "examples/surfaces/surf/surf_4.cpp"```

===! "Plot"

example_surf_5

=== "C++"

```cpp--8<-- "examples/surfaces/surf/surf_5.cpp"```

===! "Plot"

example_surf_6

=== "C++"

```cpp--8<-- "examples/surfaces/surf/surf_6.cpp"```

Surface with Contour

surfc(X, Y, Z);
See result

example_surfc_1

More Examples:

example_surfc_2example_surfc_3example_surfc_4

===! "Plot"

example_surfc_1

=== "C++"

```cpp--8<-- "examples/surfaces/surfc/surfc_1.cpp"```

More Examples:

===! "Plot"

example_surfc_2

=== "C++"

```cpp--8<-- "examples/surfaces/surfc/surfc_2.cpp"```

===! "Plot"

example_surfc_3

=== "C++"

```cpp--8<-- "examples/surfaces/surfc/surfc_3.cpp"```

===! "Plot"

example_surfc_4

=== "C++"

```cpp--8<-- "examples/surfaces/surfc/surfc_4.cpp"```

Mesh

mesh(X, Y, Z);
See result

example_mesh_1

More Examples:

example_mesh_2example_mesh_3example_mesh_4

===! "Plot"

example_mesh_1

=== "C++"

```cpp--8<-- "examples/surfaces/mesh/mesh_1.cpp"```

More Examples:

===! "Plot"

example_mesh_2

=== "C++"

```cpp--8<-- "examples/surfaces/mesh/mesh_2.cpp"```

===! "Plot"

example_mesh_3

=== "C++"

```cpp--8<-- "examples/surfaces/mesh/mesh_3.cpp"```

===! "Plot"

example_mesh_4

=== "C++"

```cpp--8<-- "examples/surfaces/mesh/mesh_4.cpp"```

Mesh with Contour

meshc(X, Y, Z);
See result

example_meshc_1

More Examples:

example_meshc_2example_meshc_3

===! "Plot"

example_meshc_1

=== "C++"

```cpp--8<-- "examples/surfaces/meshc/meshc_1.cpp"```

More Examples:

===! "Plot"

example_meshc_2

=== "C++"

```cpp--8<-- "examples/surfaces/meshc/meshc_2.cpp"```

===! "Plot"

example_meshc_3

=== "C++"

```cpp--8<-- "examples/surfaces/meshc/meshc_3.cpp"```

Mesh with Curtain

meshz(X, Y, Z);
See result

example_meshz_1

More Examples:

example_meshz_2example_meshz_3

===! "Plot"

example_meshz_1

=== "C++"

```cpp--8<-- "examples/surfaces/meshz/meshz_1.cpp"```

More Examples:

===! "Plot"

example_meshz_2

=== "C++"

```cpp--8<-- "examples/surfaces/meshz/meshz_2.cpp"```

===! "Plot"

example_meshz_3

=== "C++"

```cpp--8<-- "examples/surfaces/meshz/meshz_3.cpp"```

Function Surface

fsurf(fn);
See result

example_fsurf_1

More Examples:

example_fsurf_2example_fsurf_3example_fsurf_4example_fsurf_5example_fsurf_6example_fsurf_7example_fsurf_8

===! "Plot"

example_fsurf_1

=== "C++"

```cpp--8<-- "examples/surfaces/fsurf/fsurf_1.cpp"```

More Examples:

===! "Plot"

example_fsurf_2

=== "C++"

```cpp--8<-- "examples/surfaces/fsurf/fsurf_2.cpp"```

===! "Plot"

example_fsurf_3

=== "C++"

```cpp--8<-- "examples/surfaces/fsurf/fsurf_3.cpp"```

===! "Plot"

example_fsurf_4

=== "C++"

```cpp--8<-- "examples/surfaces/fsurf/fsurf_4.cpp"```

===! "Plot"

example_fsurf_5

=== "C++"

```cpp--8<-- "examples/surfaces/fsurf/fsurf_5.cpp"```

===! "Plot"

example_fsurf_6

=== "C++"

```cpp--8<-- "examples/surfaces/fsurf/fsurf_6.cpp"```

===! "Plot"

example_fsurf_7

=== "C++"

```cpp--8<-- "examples/surfaces/fsurf/fsurf_7.cpp"```

===! "Plot"

example_fsurf_8

=== "C++"

```cpp--8<-- "examples/surfaces/fsurf/fsurf_8.cpp"```

Function Mesh

fmesh(fn);
See result

example_fmesh_1

More Examples:

example_fmesh_2example_fmesh_3example_fmesh_4

===! "Plot"

example_fmesh_1

=== "C++"

```cpp--8<-- "examples/surfaces/fmesh/fmesh_1.cpp"```

More Examples:

===! "Plot"

example_fmesh_2

=== "C++"

```cpp--8<-- "examples/surfaces/fmesh/fmesh_2.cpp"```

===! "Plot"

example_fmesh_3

=== "C++"

```cpp--8<-- "examples/surfaces/fmesh/fmesh_3.cpp"```

===! "Plot"

example_fmesh_4

=== "C++"

```cpp--8<-- "examples/surfaces/fmesh/fmesh_4.cpp"```

Waterfall

waterfall(X, Y, Z);
See result

example_waterfall_1

More Examples:

example_waterfall_2example_waterfall_3

===! "Plot"

example_waterfall_1

=== "C++"

```cpp--8<-- "examples/surfaces/waterfall/waterfall_1.cpp"```

More Examples:

===! "Plot"

example_waterfall_2

=== "C++"

```cpp--8<-- "examples/surfaces/waterfall/waterfall_2.cpp"```

===! "Plot"

example_waterfall_3

=== "C++"

```cpp--8<-- "examples/surfaces/waterfall/waterfall_3.cpp"```

Fence

fence(X, Y, Z);
See result

example_fence_1

More Examples:

example_fence_2example_fence_3

===! "Plot"

example_fence_1

=== "C++"

```cpp--8<-- "examples/surfaces/fence/fence_1.cpp"```

More Examples:

===! "Plot"

example_fence_2

=== "C++"

```cpp--8<-- "examples/surfaces/fence/fence_2.cpp"```

===! "Plot"

example_fence_3

=== "C++"

```cpp--8<-- "examples/surfaces/fence/fence_3.cpp"```

Ribbon

ribbon(X, Y, Z);
See result

example_ribbon_1

More Examples:

example_ribbon_2example_ribbon_3example_ribbon_4

===! "Plot"

example_ribbon_1

=== "C++"

```cpp--8<-- "examples/surfaces/ribbon/ribbon_1.cpp"```

More Examples:

===! "Plot"

example_ribbon_2

=== "C++"

```cpp--8<-- "examples/surfaces/ribbon/ribbon_2.cpp"```

===! "Plot"

example_ribbon_3

=== "C++"

```cpp--8<-- "examples/surfaces/ribbon/ribbon_3.cpp"```

===! "Plot"

example_ribbon_4

=== "C++"

```cpp--8<-- "examples/surfaces/ribbon/ribbon_4.cpp"```

Graphs

Undirected Graph |Directed Graph

Undirected Graph

graph(edges);
See result

example_graph_1

More Examples:

example_graph_2example_graph_3example_graph_4example_graph_5

===! "Plot"

example_graph_1

=== "C++"

```cpp--8<-- "examples/graphs/graph/graph_1.cpp"```

More Examples:

===! "Plot"

example_graph_2

=== "C++"

```cpp--8<-- "examples/graphs/graph/graph_2.cpp"```

===! "Plot"

example_graph_3

=== "C++"

```cpp--8<-- "examples/graphs/graph/graph_3.cpp"```

===! "Plot"

example_graph_4

=== "C++"

```cpp--8<-- "examples/graphs/graph/graph_4.cpp"```

===! "Plot"

example_graph_5

=== "C++"

```cpp--8<-- "examples/graphs/graph/graph_5.cpp"```

All these subcategories depend on thenetwork class. Graphs are abstract structures that represent objects and relationships between these objects. The objects are represented as vertices and the relationships are depicted as edges.

In an abstract graph, the vertices have no specific position in space. Mathematically, a graph does not depend on its layout. However, the graph layout has a large impact on its understandability. Thenetwork class can calculate appropriate positions for graph vertices with several algorithms: Kamada Kawai algorithm, Fruchterman-Reingold algorithm, circle layout, random layout, and automatic layout.

The implementation of the Kamada Kawai and Fruchterman-Reingold algorithms depend on the NodeSoup library. The automatic layout uses the Kamada Kawai algorithm for small graphs and the Fruchterman-Reingold algorithm for larger graphs.

Directed Graph

digraph(edges);
See result

example_digraph_1

More Examples:

example_digraph_2example_digraph_3

===! "Plot"

example_digraph_1

=== "C++"

```cpp--8<-- "examples/graphs/digraph/digraph_1.cpp"```

More Examples:

===! "Plot"

example_digraph_2

=== "C++"

```cpp--8<-- "examples/graphs/digraph/digraph_2.cpp"```

===! "Plot"

example_digraph_3

=== "C++"

```cpp--8<-- "examples/graphs/digraph/digraph_3.cpp"```

Images

Image Show |Image Matrix |Scaled Image

Image Show

imshow(image);
See result

example_imshow_1

More Examples:

example_imshow_2example_imshow_3example_imshow_4example_imshow_5example_imshow_6example_imshow_7example_imshow_8example_imshow_9example_imshow_10example_imshow_11

===! "Plot"

example_imshow_1

=== "C++"

```cpp--8<-- "examples/images/imshow/imshow_1.cpp"```

More Examples:

===! "Plot"

example_imshow_2

=== "C++"

```cpp--8<-- "examples/images/imshow/imshow_2.cpp"```

===! "Plot"

example_imshow_3

=== "C++"

```cpp--8<-- "examples/images/imshow/imshow_3.cpp"```

===! "Plot"

example_imshow_4

=== "C++"

```cpp--8<-- "examples/images/imshow/imshow_4.cpp"```

===! "Plot"

example_imshow_5

=== "C++"

```cpp--8<-- "examples/images/imshow/imshow_5.cpp"```

===! "Plot"

example_imshow_6

=== "C++"

```cpp--8<-- "examples/images/imshow/imshow_6.cpp"```

===! "Plot"

example_imshow_7

=== "C++"

```cpp--8<-- "examples/images/imshow/imshow_7.cpp"```

===! "Plot"

example_imshow_8

=== "C++"

```cpp--8<-- "examples/images/imshow/imshow_8.cpp"```

===! "Plot"

example_imshow_9

=== "C++"

```cpp--8<-- "examples/images/imshow/imshow_9.cpp"```

===! "Plot"

example_imshow_10

=== "C++"

```cpp--8<-- "examples/images/imshow/imshow_10.cpp"```

===! "Plot"

example_imshow_11

=== "C++"

```cpp--8<-- "examples/images/imshow/imshow_11.cpp"```

These subcategories depend on thematrix class. Thematrix class can have up to four matrices. If it has only one matrix, it is represented with a colormap. If it has three matrices, they represent the red, green, and blue channels. If it has four matrices, the fourth matrix represents an alpha channel to control the transparency of each pixel.

We use the CImg library to load and save images. CImg can handle many common image formats as long as it has access to the appropriate libraries. TheMatplot++ build script will look at compile-time for the following optional libraries: JPEG, TIFF, ZLIB, PNG, LAPACK, BLAS, OpenCV, X11, fftw3, OpenEXR, and Magick++. The build script will attempt to link all libraries from this list toMatplot++.

Matplot++ includes a few convenience functions to manipulate matrices with images:imread,rgb2gray,gray2rgb,imresize, andimwrite. All these functions work with lists of matrices.

Image Matrix

image(C);
See result

example_image_1

More Examples:

example_image_2example_image_3example_image_4example_image_5

===! "Plot"

example_image_1

=== "C++"

```cpp--8<-- "examples/images/image/image_1.cpp"```

More Examples:

===! "Plot"

example_image_2

=== "C++"

```cpp--8<-- "examples/images/image/image_2.cpp"```

===! "Plot"

example_image_3

=== "C++"

```cpp--8<-- "examples/images/image/image_3.cpp"```

===! "Plot"

example_image_4

=== "C++"

```cpp--8<-- "examples/images/image/image_4.cpp"```

===! "Plot"

example_image_5

=== "C++"

```cpp--8<-- "examples/images/image/image_5.cpp"```

Scaled Image

imagesc(C);
See result

example_imagesc_1

More Examples:

example_imagesc_2example_imagesc_3example_imagesc_4

===! "Plot"

example_imagesc_1

=== "C++"

```cpp--8<-- "examples/images/imagesc/imagesc_1.cpp"```

More Examples:

===! "Plot"

example_imagesc_2

=== "C++"

```cpp--8<-- "examples/images/imagesc/imagesc_2.cpp"```

===! "Plot"

example_imagesc_3

=== "C++"

```cpp--8<-- "examples/images/imagesc/imagesc_3.cpp"```

===! "Plot"

example_imagesc_4

=== "C++"

```cpp--8<-- "examples/images/imagesc/imagesc_4.cpp"```

Annotations

Text |Text with Arrow |Rectangle |Filled Polygon |Ellipse |Textbox |Arrow |Line

Text

The annotations category is meant to create individual objects on the plot rather than representations of data sets. An important difference between the annotations category and other categories is that, by default, the annotations do not replace the plot that already exists in theaxes object, even if the user does not call thehold function.

text(x0, y0, str);
See result

example_text_1

More Examples:

example_text_2example_text_3example_text_4example_text_5example_text_6example_text_7example_text_8

===! "Plot"

example_text_1

=== "C++"

```cpp--8<-- "examples/annotations/text/text_1.cpp"```

More Examples:

===! "Plot"

example_text_2

=== "C++"

```cpp--8<-- "examples/annotations/text/text_2.cpp"```

===! "Plot"

example_text_3

=== "C++"

```cpp--8<-- "examples/annotations/text/text_3.cpp"```

===! "Plot"

example_text_4

=== "C++"

```cpp--8<-- "examples/annotations/text/text_4.cpp"```

===! "Plot"

example_text_5

=== "C++"

```cpp--8<-- "examples/annotations/text/text_5.cpp"```

===! "Plot"

example_text_6

=== "C++"

```cpp--8<-- "examples/annotations/text/text_6.cpp"```

===! "Plot"

example_text_7

=== "C++"

```cpp--8<-- "examples/annotations/text/text_7.cpp"```

===! "Plot"

example_text_8

=== "C++"

```cpp--8<-- "examples/annotations/text/text_8.cpp"```

Text with Arrow

textarrow(x1, y1, x2, y2, str);
See result

example_textarrow_1

More Examples:

example_textarrow_2

===! "Plot"

example_textarrow_1

=== "C++"

```cpp--8<-- "examples/annotations/textarrow/textarrow_1.cpp"```

More Examples:

===! "Plot"

example_textarrow_2

=== "C++"

```cpp--8<-- "examples/annotations/textarrow/textarrow_2.cpp"```

Rectangle

rectangle(x, y, w, h);
See result

example_rectangle_1

More Examples:

example_rectangle_2example_rectangle_3example_rectangle_4example_rectangle_5

===! "Plot"

example_rectangle_1

=== "C++"

```cpp--8<-- "examples/annotations/rectangle/rectangle_1.cpp"```

More Examples:

===! "Plot"

example_rectangle_2

=== "C++"

```cpp--8<-- "examples/annotations/rectangle/rectangle_2.cpp"```

===! "Plot"

example_rectangle_3

=== "C++"

```cpp--8<-- "examples/annotations/rectangle/rectangle_3.cpp"```

===! "Plot"

example_rectangle_4

=== "C++"

```cpp--8<-- "examples/annotations/rectangle/rectangle_4.cpp"```

===! "Plot"

example_rectangle_5

=== "C++"

```cpp--8<-- "examples/annotations/rectangle/rectangle_5.cpp"```

The rectangle object can have a border curvature from to. We can also annotate with text, arrows, polygons, and lines.

Filled Polygon

polygon(x0, y0, color);
See result

example_fill_1

===! "Plot"

example_fill_1

=== "C++"

```cpp--8<-- "examples/annotations/fill/fill_1.cpp"```

Ellipse

ellipse(x, y, w, h);
See result

example_ellipse_1

===! "Plot"

example_ellipse_1

=== "C++"

```cpp--8<-- "examples/annotations/ellipse/ellipse_1.cpp"```

Textbox

textbox(x, y, w, h, str);
See result

example_textbox_1

===! "Plot"

example_textbox_1

=== "C++"

```cpp--8<-- "examples/annotations/textbox/textbox_1.cpp"```

Arrow

arrow(x1, y1, x2, y2);
See result

example_arrow_1

More Examples:

example_arrow_2

===! "Plot"

example_arrow_1

=== "C++"

```cpp--8<-- "examples/annotations/arrow/arrow_1.cpp"```

More Examples:

===! "Plot"

example_arrow_2

=== "C++"

```cpp--8<-- "examples/annotations/arrow/arrow_2.cpp"```

Line

line(x1, y1, x2, y2);
See result

example_line_1

===! "Plot"

example_line_1

=== "C++"

```cpp--8<-- "examples/annotations/line/line_1.cpp"```

Appearance

Labels

Title

title(str);
See result

example_title_1

More Examples:

example_title_2example_title_3example_title_4example_title_5example_title_6example_title_7example_title_8

===! "Plot"

example_title_1

=== "C++"

```cpp--8<-- "examples/appearance/labels/title/title_1.cpp"```

More Examples:

===! "Plot"

example_title_2

=== "C++"

```cpp--8<-- "examples/appearance/labels/title/title_2.cpp"```

===! "Plot"

example_title_3

=== "C++"

```cpp--8<-- "examples/appearance/labels/title/title_3.cpp"```

===! "Plot"

example_title_4

=== "C++"

```cpp--8<-- "examples/appearance/labels/title/title_4.cpp"```

===! "Plot"

example_title_5

=== "C++"

```cpp--8<-- "examples/appearance/labels/title/title_5.cpp"```

===! "Plot"

example_title_6

=== "C++"

```cpp--8<-- "examples/appearance/labels/title/title_6.cpp"```

===! "Plot"

example_title_7

=== "C++"

```cpp--8<-- "examples/appearance/labels/title/title_7.cpp"```

===! "Plot"

example_title_8

=== "C++"

```cpp--8<-- "examples/appearance/labels/title/title_8.cpp"```

Subplot Title

sgtitle(str);
See result

example_sgtitle_1

More Examples:

example_sgtitle_2

===! "Plot"

example_sgtitle_1

=== "C++"

```cpp--8<-- "examples/appearance/labels/sgtitle/sgtitle_1.cpp"```

More Examples:

===! "Plot"

example_sgtitle_2

=== "C++"

```cpp--8<-- "examples/appearance/labels/sgtitle/sgtitle_2.cpp"```

X Label

xlabel(str);
See result

example_xlabel_1

More Examples:

example_xlabel_2example_xlabel_3example_xlabel_4example_xlabel_5example_xlabel_6example_xlabel_7example_xlabel_8

===! "Plot"

example_xlabel_1

=== "C++"

```cpp--8<-- "examples/appearance/labels/xlabel/xlabel_1.cpp"```

More Examples:

===! "Plot"

example_xlabel_2

=== "C++"

```cpp--8<-- "examples/appearance/labels/xlabel/xlabel_2.cpp"```

===! "Plot"

example_xlabel_3

=== "C++"

```cpp--8<-- "examples/appearance/labels/xlabel/xlabel_3.cpp"```

===! "Plot"

example_xlabel_4

=== "C++"

```cpp--8<-- "examples/appearance/labels/xlabel/xlabel_4.cpp"```

===! "Plot"

example_xlabel_5

=== "C++"

```cpp--8<-- "examples/appearance/labels/xlabel/xlabel_5.cpp"```

===! "Plot"

example_xlabel_6

=== "C++"

```cpp--8<-- "examples/appearance/labels/xlabel/xlabel_6.cpp"```

===! "Plot"

example_xlabel_7

=== "C++"

```cpp--8<-- "examples/appearance/labels/xlabel/xlabel_7.cpp"```

===! "Plot"

example_xlabel_8

=== "C++"

```cpp--8<-- "examples/appearance/labels/xlabel/xlabel_8.cpp"```

Y Label

ylabel(str);
See result

example_ylabel_1

More Examples:

example_ylabel_2example_ylabel_3example_ylabel_4example_ylabel_5example_ylabel_6example_ylabel_7example_ylabel_8

===! "Plot"

example_ylabel_1

=== "C++"

```cpp--8<-- "examples/appearance/labels/ylabel/ylabel_1.cpp"```

More Examples:

===! "Plot"

example_ylabel_2

=== "C++"

```cpp--8<-- "examples/appearance/labels/ylabel/ylabel_2.cpp"```

===! "Plot"

example_ylabel_3

=== "C++"

```cpp--8<-- "examples/appearance/labels/ylabel/ylabel_3.cpp"```

===! "Plot"

example_ylabel_4

=== "C++"

```cpp--8<-- "examples/appearance/labels/ylabel/ylabel_4.cpp"```

===! "Plot"

example_ylabel_5

=== "C++"

```cpp--8<-- "examples/appearance/labels/ylabel/ylabel_5.cpp"```

===! "Plot"

example_ylabel_6

=== "C++"

```cpp--8<-- "examples/appearance/labels/ylabel/ylabel_6.cpp"```

===! "Plot"

example_ylabel_7

=== "C++"

```cpp--8<-- "examples/appearance/labels/ylabel/ylabel_7.cpp"```

===! "Plot"

example_ylabel_8

=== "C++"

```cpp--8<-- "examples/appearance/labels/ylabel/ylabel_8.cpp"```

Z Label

zlabel(str);
See result

example_zlabel_1

More Examples:

example_zlabel_2example_zlabel_3

===! "Plot"

example_zlabel_1

=== "C++"

```cpp--8<-- "examples/appearance/labels/zlabel/zlabel_1.cpp"```

More Examples:

===! "Plot"

example_zlabel_2

=== "C++"

```cpp--8<-- "examples/appearance/labels/zlabel/zlabel_2.cpp"```

===! "Plot"

example_zlabel_3

=== "C++"

```cpp--8<-- "examples/appearance/labels/zlabel/zlabel_3.cpp"```

Legend

legend({str1,str2,str3});
See result

example_legend_1

More Examples:

example_legend_2example_legend_3example_legend_4example_legend_5example_legend_6example_legend_7example_legend_8

===! "Plot"

example_legend_1

=== "C++"

```cpp--8<-- "examples/appearance/labels/legend/legend_1.cpp"```

More Examples:

===! "Plot"

example_legend_2

=== "C++"

```cpp--8<-- "examples/appearance/labels/legend/legend_2.cpp"```

===! "Plot"

example_legend_3

=== "C++"

```cpp--8<-- "examples/appearance/labels/legend/legend_3.cpp"```

===! "Plot"

example_legend_4

=== "C++"

```cpp--8<-- "examples/appearance/labels/legend/legend_4.cpp"```

===! "Plot"

example_legend_5

=== "C++"

```cpp--8<-- "examples/appearance/labels/legend/legend_5.cpp"```

===! "Plot"

example_legend_6

=== "C++"

```cpp--8<-- "examples/appearance/labels/legend/legend_6.cpp"```

===! "Plot"

example_legend_7

=== "C++"

```cpp--8<-- "examples/appearance/labels/legend/legend_7.cpp"```

===! "Plot"

example_legend_8

=== "C++"

```cpp--8<-- "examples/appearance/labels/legend/legend_8.cpp"```

Axis

X Limits

xlim({xmin,xmax});
See result

example_xlim_1

More Examples:

example_xlim_2example_xlim_3example_xlim_4example_xlim_5example_xlim_6

===! "Plot"

example_xlim_1

=== "C++"

```cpp--8<-- "examples/appearance/axis/xlim/xlim_1.cpp"```

More Examples:

===! "Plot"

example_xlim_2

=== "C++"

```cpp--8<-- "examples/appearance/axis/xlim/xlim_2.cpp"```

===! "Plot"

example_xlim_3

=== "C++"

```cpp--8<-- "examples/appearance/axis/xlim/xlim_3.cpp"```

===! "Plot"

example_xlim_4

=== "C++"

```cpp--8<-- "examples/appearance/axis/xlim/xlim_4.cpp"```

===! "Plot"

example_xlim_5

=== "C++"

```cpp--8<-- "examples/appearance/axis/xlim/xlim_5.cpp"```

===! "Plot"

example_xlim_6

=== "C++"

```cpp--8<-- "examples/appearance/axis/xlim/xlim_6.cpp"```

Y Limits

ylim({ymin,ymax});
See result

example_ylim_1

More Examples:

example_ylim_2example_ylim_3example_ylim_4example_ylim_5example_ylim_6

===! "Plot"

example_ylim_1

=== "C++"

```cpp--8<-- "examples/appearance/axis/ylim/ylim_1.cpp"```

More Examples:

===! "Plot"

example_ylim_2

=== "C++"

```cpp--8<-- "examples/appearance/axis/ylim/ylim_2.cpp"```

===! "Plot"

example_ylim_3

=== "C++"

```cpp--8<-- "examples/appearance/axis/ylim/ylim_3.cpp"```

===! "Plot"

example_ylim_4

=== "C++"

```cpp--8<-- "examples/appearance/axis/ylim/ylim_4.cpp"```

===! "Plot"

example_ylim_5

=== "C++"

```cpp--8<-- "examples/appearance/axis/ylim/ylim_5.cpp"```

===! "Plot"

example_ylim_6

=== "C++"

```cpp--8<-- "examples/appearance/axis/ylim/ylim_6.cpp"```

Z Limits

zlim({zmin,zmax});
See result

example_zlim_1

More Examples:

example_zlim_2example_zlim_3example_zlim_4example_zlim_5example_zlim_6

===! "Plot"

example_zlim_1

=== "C++"

```cpp--8<-- "examples/appearance/axis/zlim/zlim_1.cpp"```

More Examples:

===! "Plot"

example_zlim_2

=== "C++"

```cpp--8<-- "examples/appearance/axis/zlim/zlim_2.cpp"```

===! "Plot"

example_zlim_3

=== "C++"

```cpp--8<-- "examples/appearance/axis/zlim/zlim_3.cpp"```

===! "Plot"

example_zlim_4

=== "C++"

```cpp--8<-- "examples/appearance/axis/zlim/zlim_4.cpp"```

===! "Plot"

example_zlim_5

=== "C++"

```cpp--8<-- "examples/appearance/axis/zlim/zlim_5.cpp"```

===! "Plot"

example_zlim_6

=== "C++"

```cpp--8<-- "examples/appearance/axis/zlim/zlim_6.cpp"```

Adjust Axis

axis({xmin, xmax, ymin, ymax});
See result

example_axis_1

More Examples:

example_axis_2example_axis_3example_axis_4example_axis_5example_axis_6example_axis_7example_axis_8

===! "Plot"

example_axis_1

=== "C++"

```cpp--8<-- "examples/appearance/axis/axis/axis_1.cpp"```

More Examples:

===! "Plot"

example_axis_2

=== "C++"

```cpp--8<-- "examples/appearance/axis/axis/axis_2.cpp"```

===! "Plot"

example_axis_3

=== "C++"

```cpp--8<-- "examples/appearance/axis/axis/axis_3.cpp"```

===! "Plot"

example_axis_4

=== "C++"

```cpp--8<-- "examples/appearance/axis/axis/axis_4.cpp"```

===! "Plot"

example_axis_5

=== "C++"

```cpp--8<-- "examples/appearance/axis/axis/axis_5.cpp"```

===! "Plot"

example_axis_6

=== "C++"

```cpp--8<-- "examples/appearance/axis/axis/axis_6.cpp"```

===! "Plot"

example_axis_7

=== "C++"

```cpp--8<-- "examples/appearance/axis/axis/axis_7.cpp"```

===! "Plot"

example_axis_8

=== "C++"

```cpp--8<-- "examples/appearance/axis/axis/axis_8.cpp"```

Box

box(on);
See result

example_box_1

More Examples:

example_box_2example_box_3

===! "Plot"

example_box_1

=== "C++"

```cpp--8<-- "examples/appearance/axis/box/box_1.cpp"```

More Examples:

===! "Plot"

example_box_2

=== "C++"

```cpp--8<-- "examples/appearance/axis/box/box_2.cpp"```

===! "Plot"

example_box_3

=== "C++"

```cpp--8<-- "examples/appearance/axis/box/box_3.cpp"```

Grid

Grid Background

grid(on);
See result

example_grid_1

More Examples:

example_grid_2example_grid_3example_grid_4

===! "Plot"

example_grid_1

=== "C++"

```cpp--8<-- "examples/appearance/grid/grid/grid_1.cpp"```

More Examples:

===! "Plot"

example_grid_2

=== "C++"

```cpp--8<-- "examples/appearance/grid/grid/grid_2.cpp"```

===! "Plot"

example_grid_3

=== "C++"

```cpp--8<-- "examples/appearance/grid/grid/grid_3.cpp"```

===! "Plot"

example_grid_4

=== "C++"

```cpp--8<-- "examples/appearance/grid/grid/grid_4.cpp"```

X Ticks

xticks(xs);
See result

example_xticks_1

More Examples:

example_xticks_2example_xticks_3example_xticks_4example_xticks_5example_xticks_6example_xticks_7example_xticks_8

===! "Plot"

example_xticks_1

=== "C++"

```cpp--8<-- "examples/appearance/grid/xticks/xticks_1.cpp"```

More Examples:

===! "Plot"

example_xticks_2

=== "C++"

```cpp--8<-- "examples/appearance/grid/xticks/xticks_2.cpp"```

===! "Plot"

example_xticks_3

=== "C++"

```cpp--8<-- "examples/appearance/grid/xticks/xticks_3.cpp"```

===! "Plot"

example_xticks_4

=== "C++"

```cpp--8<-- "examples/appearance/grid/xticks/xticks_4.cpp"```

===! "Plot"

example_xticks_5

=== "C++"

```cpp--8<-- "examples/appearance/grid/xticks/xticks_5.cpp"```

===! "Plot"

example_xticks_6

=== "C++"

```cpp--8<-- "examples/appearance/grid/xticks/xticks_6.cpp"```

===! "Plot"

example_xticks_7

=== "C++"

```cpp--8<-- "examples/appearance/grid/xticks/xticks_7.cpp"```

===! "Plot"

example_xticks_8

=== "C++"

```cpp--8<-- "examples/appearance/grid/xticks/xticks_8.cpp"```

Y Ticks

yticks(ys);
See result

example_yticks_1

More Examples:

example_yticks_2example_yticks_3example_yticks_4example_yticks_5example_yticks_6example_yticks_7example_yticks_8

===! "Plot"

example_yticks_1

=== "C++"

```cpp--8<-- "examples/appearance/grid/yticks/yticks_1.cpp"```

More Examples:

===! "Plot"

example_yticks_2

=== "C++"

```cpp--8<-- "examples/appearance/grid/yticks/yticks_2.cpp"```

===! "Plot"

example_yticks_3

=== "C++"

```cpp--8<-- "examples/appearance/grid/yticks/yticks_3.cpp"```

===! "Plot"

example_yticks_4

=== "C++"

```cpp--8<-- "examples/appearance/grid/yticks/yticks_4.cpp"```

===! "Plot"

example_yticks_5

=== "C++"

```cpp--8<-- "examples/appearance/grid/yticks/yticks_5.cpp"```

===! "Plot"

example_yticks_6

=== "C++"

```cpp--8<-- "examples/appearance/grid/yticks/yticks_6.cpp"```

===! "Plot"

example_yticks_7

=== "C++"

```cpp--8<-- "examples/appearance/grid/yticks/yticks_7.cpp"```

===! "Plot"

example_yticks_8

=== "C++"

```cpp--8<-- "examples/appearance/grid/yticks/yticks_8.cpp"```

Z Ticks

zticks(zs);
See result

example_zticks_1

More Examples:

example_zticks_2example_zticks_3example_zticks_4example_zticks_5example_zticks_6

===! "Plot"

example_zticks_1

=== "C++"

```cpp--8<-- "examples/appearance/grid/zticks/zticks_1.cpp"```

More Examples:

===! "Plot"

example_zticks_2

=== "C++"

```cpp--8<-- "examples/appearance/grid/zticks/zticks_2.cpp"```

===! "Plot"

example_zticks_3

=== "C++"

```cpp--8<-- "examples/appearance/grid/zticks/zticks_3.cpp"```

===! "Plot"

example_zticks_4

=== "C++"

```cpp--8<-- "examples/appearance/grid/zticks/zticks_4.cpp"```

===! "Plot"

example_zticks_5

=== "C++"

```cpp--8<-- "examples/appearance/grid/zticks/zticks_5.cpp"```

===! "Plot"

example_zticks_6

=== "C++"

```cpp--8<-- "examples/appearance/grid/zticks/zticks_6.cpp"```

X Tick Labels

xticklabels(xstrs);
See result

example_xticklabels_1

More Examples:

example_xticklabels_2example_xticklabels_3example_xticklabels_4

===! "Plot"

example_xticklabels_1

=== "C++"

```cpp--8<-- "examples/appearance/grid/xticklabels/xticklabels_1.cpp"```

More Examples:

===! "Plot"

example_xticklabels_2

=== "C++"

```cpp--8<-- "examples/appearance/grid/xticklabels/xticklabels_2.cpp"```

===! "Plot"

example_xticklabels_3

=== "C++"

```cpp--8<-- "examples/appearance/grid/xticklabels/xticklabels_3.cpp"```

===! "Plot"

example_xticklabels_4

=== "C++"

```cpp--8<-- "examples/appearance/grid/xticklabels/xticklabels_4.cpp"```

Y Tick Labels

yticklabels(ystrs);
See result

example_yticklabels_1

More Examples:

example_yticklabels_2example_yticklabels_3example_yticklabels_4

===! "Plot"

example_yticklabels_1

=== "C++"

```cpp--8<-- "examples/appearance/grid/yticklabels/yticklabels_1.cpp"```

More Examples:

===! "Plot"

example_yticklabels_2

=== "C++"

```cpp--8<-- "examples/appearance/grid/yticklabels/yticklabels_2.cpp"```

===! "Plot"

example_yticklabels_3

=== "C++"

```cpp--8<-- "examples/appearance/grid/yticklabels/yticklabels_3.cpp"```

===! "Plot"

example_yticklabels_4

=== "C++"

```cpp--8<-- "examples/appearance/grid/yticklabels/yticklabels_4.cpp"```

X Tick Format

xtickformat(fmtstr);
See result

example_xtickformat_1

More Examples:

example_xtickformat_2example_xtickformat_3example_xtickformat_4example_xtickformat_5

===! "Plot"

example_xtickformat_1

=== "C++"

```cpp--8<-- "examples/appearance/grid/xtickformat/xtickformat_1.cpp"```

More Examples:

===! "Plot"

example_xtickformat_2

=== "C++"

```cpp--8<-- "examples/appearance/grid/xtickformat/xtickformat_2.cpp"```

===! "Plot"

example_xtickformat_3

=== "C++"

```cpp--8<-- "examples/appearance/grid/xtickformat/xtickformat_3.cpp"```

===! "Plot"

example_xtickformat_4

=== "C++"

```cpp--8<-- "examples/appearance/grid/xtickformat/xtickformat_4.cpp"```

===! "Plot"

example_xtickformat_5

=== "C++"

```cpp--8<-- "examples/appearance/grid/xtickformat/xtickformat_5.cpp"```

Y Tick Format

ytickformat(fmtstr);
See result

example_ytickformat_1

More Examples:

example_ytickformat_2example_ytickformat_3example_ytickformat_4example_ytickformat_5

===! "Plot"

example_ytickformat_1

=== "C++"

```cpp--8<-- "examples/appearance/grid/ytickformat/ytickformat_1.cpp"```

More Examples:

===! "Plot"

example_ytickformat_2

=== "C++"

```cpp--8<-- "examples/appearance/grid/ytickformat/ytickformat_2.cpp"```

===! "Plot"

example_ytickformat_3

=== "C++"

```cpp--8<-- "examples/appearance/grid/ytickformat/ytickformat_3.cpp"```

===! "Plot"

example_ytickformat_4

=== "C++"

```cpp--8<-- "examples/appearance/grid/ytickformat/ytickformat_4.cpp"```

===! "Plot"

example_ytickformat_5

=== "C++"

```cpp--8<-- "examples/appearance/grid/ytickformat/ytickformat_5.cpp"```

Z Tick Format

ztickformat(fmtstr);
See result

example_ztickformat_1

More Examples:

example_ztickformat_2example_ztickformat_3example_ztickformat_4example_ztickformat_5

===! "Plot"

example_ztickformat_1

=== "C++"

```cpp--8<-- "examples/appearance/grid/ztickformat/ztickformat_1.cpp"```

More Examples:

===! "Plot"

example_ztickformat_2

=== "C++"

```cpp--8<-- "examples/appearance/grid/ztickformat/ztickformat_2.cpp"```

===! "Plot"

example_ztickformat_3

=== "C++"

```cpp--8<-- "examples/appearance/grid/ztickformat/ztickformat_3.cpp"```

===! "Plot"

example_ztickformat_4

=== "C++"

```cpp--8<-- "examples/appearance/grid/ztickformat/ztickformat_4.cpp"```

===! "Plot"

example_ztickformat_5

=== "C++"

```cpp--8<-- "examples/appearance/grid/ztickformat/ztickformat_5.cpp"```

X Tick Angle

xtickangle(ang);
See result

example_xtickangle_1

More Examples:

example_xtickangle_2example_xtickangle_3

===! "Plot"

example_xtickangle_1

=== "C++"

```cpp--8<-- "examples/appearance/grid/xtickangle/xtickangle_1.cpp"```

More Examples:

===! "Plot"

example_xtickangle_2

=== "C++"

```cpp--8<-- "examples/appearance/grid/xtickangle/xtickangle_2.cpp"```

===! "Plot"

example_xtickangle_3

=== "C++"

```cpp--8<-- "examples/appearance/grid/xtickangle/xtickangle_3.cpp"```

Y Tick Angle

ytickangle(ang);
See result

example_ytickangle_1

More Examples:

example_ytickangle_2example_ytickangle_3

===! "Plot"

example_ytickangle_1

=== "C++"

```cpp--8<-- "examples/appearance/grid/ytickangle/ytickangle_1.cpp"```

More Examples:

===! "Plot"

example_ytickangle_2

=== "C++"

```cpp--8<-- "examples/appearance/grid/ytickangle/ytickangle_2.cpp"```

===! "Plot"

example_ytickangle_3

=== "C++"

```cpp--8<-- "examples/appearance/grid/ytickangle/ytickangle_3.cpp"```

Multiplot

Hold

hold(on);
See result

example_hold_1

More Examples:

example_hold_2example_hold_3example_hold_4

===! "Plot"

example_hold_1

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/hold/hold_1.cpp"```

More Examples:

===! "Plot"

example_hold_2

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/hold/hold_2.cpp"```

===! "Plot"

example_hold_3

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/hold/hold_3.cpp"```

===! "Plot"

example_hold_4

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/hold/hold_4.cpp"```

YY-axis

plot(x, y)->use_y2(true);
See result

example_yyaxis_1

More Examples:

example_yyaxis_2example_yyaxis_3example_yyaxis_4example_yyaxis_5example_yyaxis_6

===! "Plot"

example_yyaxis_1

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/yyaxis/yyaxis_1.cpp"```

More Examples:

===! "Plot"

example_yyaxis_2

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/yyaxis/yyaxis_2.cpp"```

===! "Plot"

example_yyaxis_3

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/yyaxis/yyaxis_3.cpp"```

===! "Plot"

example_yyaxis_4

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/yyaxis/yyaxis_4.cpp"```

===! "Plot"

example_yyaxis_5

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/yyaxis/yyaxis_5.cpp"```

===! "Plot"

example_yyaxis_6

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/yyaxis/yyaxis_6.cpp"```

Color Order

colororder(colors);
See result

example_colororder_1

More Examples:

example_colororder_2example_colororder_3example_colororder_4example_colororder_5example_colororder_6example_colororder_7

===! "Plot"

example_colororder_1

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/colororder/colororder_1.cpp"```

More Examples:

===! "Plot"

example_colororder_2

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/colororder/colororder_2.cpp"```

===! "Plot"

example_colororder_3

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/colororder/colororder_3.cpp"```

===! "Plot"

example_colororder_4

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/colororder/colororder_4.cpp"```

===! "Plot"

example_colororder_5

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/colororder/colororder_5.cpp"```

===! "Plot"

example_colororder_6

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/colororder/colororder_6.cpp"```

===! "Plot"

example_colororder_7

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/colororder/colororder_7.cpp"```

Subplots

subplot(rows, cols, id);

Unlike other libraries, subplots uses 0-based indices.

See result

example_subplot_1

More Examples:

example_subplot_2example_subplot_3example_subplot_4example_subplot_5example_subplot_6example_subplot_7example_subplot_8example_subplot_9example_subplot_10example_subplot_11example_subplot_12example_subplot_13

===! "Plot"

example_subplot_1

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/subplot/subplot_1.cpp"```

More Examples:

===! "Plot"

example_subplot_2

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/subplot/subplot_2.cpp"```

===! "Plot"

example_subplot_3

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/subplot/subplot_3.cpp"```

===! "Plot"

example_subplot_4

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/subplot/subplot_4.cpp"```

===! "Plot"

example_subplot_5

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/subplot/subplot_5.cpp"```

===! "Plot"

example_subplot_6

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/subplot/subplot_6.cpp"```

===! "Plot"

example_subplot_7

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/subplot/subplot_7.cpp"```

===! "Plot"

example_subplot_8

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/subplot/subplot_8.cpp"```

===! "Plot"

example_subplot_9

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/subplot/subplot_9.cpp"```

===! "Plot"

example_subplot_10

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/subplot/subplot_10.cpp"```

===! "Plot"

example_subplot_11

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/subplot/subplot_11.cpp"```

===! "Plot"

example_subplot_12

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/subplot/subplot_12.cpp"```

===! "Plot"

example_subplot_13

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/subplot/subplot_13.cpp"```

Tiled Layout

tiledlayout(rows, cols);nexttile();
See result

example_tiledlayout_1

More Examples:

example_tiledlayout_2example_tiledlayout_3example_tiledlayout_4example_tiledlayout_5example_tiledlayout_6example_tiledlayout_7example_tiledlayout_8

===! "Plot"

example_tiledlayout_1

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/tiledlayout/tiledlayout_1.cpp"```

More Examples:

===! "Plot"

example_tiledlayout_2

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/tiledlayout/tiledlayout_2.cpp"```

===! "Plot"

example_tiledlayout_3

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/tiledlayout/tiledlayout_3.cpp"```

===! "Plot"

example_tiledlayout_4

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/tiledlayout/tiledlayout_4.cpp"```

===! "Plot"

example_tiledlayout_5

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/tiledlayout/tiledlayout_5.cpp"```

===! "Plot"

example_tiledlayout_6

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/tiledlayout/tiledlayout_6.cpp"```

===! "Plot"

example_tiledlayout_7

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/tiledlayout/tiledlayout_7.cpp"```

===! "Plot"

example_tiledlayout_8

=== "C++"

```cpp--8<-- "examples/appearance/multiplot/tiledlayout/tiledlayout_8.cpp"```

Our tiling functions are convenience shortcuts for the subplot functions. If there is no room for the next tile, we automatically rearrange the axes and increase the number of subplot rows or columns to fit the next tile. Use subplots for more control over the subplots.

Colormaps

Colormap

As a convenience, thecolors.h header contains many functions to generate colors from strings and vice-versa.

colormap(colors);
See result

example_colormap_1

More Examples:

example_colormap_2example_colormap_3example_colormap_4example_colormap_5example_colormap_6example_colormap_7example_colormap_8example_colormap_9

===! "Plot"

example_colormap_1

=== "C++"

```cpp--8<-- "examples/appearance/colormaps/colormap/colormap_1.cpp"```

More Examples:

===! "Plot"

example_colormap_2

=== "C++"

```cpp--8<-- "examples/appearance/colormaps/colormap/colormap_2.cpp"```

===! "Plot"

example_colormap_3

=== "C++"

```cpp--8<-- "examples/appearance/colormaps/colormap/colormap_3.cpp"```

===! "Plot"

example_colormap_4

=== "C++"

```cpp--8<-- "examples/appearance/colormaps/colormap/colormap_4.cpp"```

===! "Plot"

example_colormap_5

=== "C++"

```cpp--8<-- "examples/appearance/colormaps/colormap/colormap_5.cpp"```

===! "Plot"

example_colormap_6

=== "C++"

```cpp--8<-- "examples/appearance/colormaps/colormap/colormap_6.cpp"```

===! "Plot"

example_colormap_7

=== "C++"

```cpp--8<-- "examples/appearance/colormaps/colormap/colormap_7.cpp"```

===! "Plot"

example_colormap_8

=== "C++"

```cpp--8<-- "examples/appearance/colormaps/colormap/colormap_8.cpp"```

===! "Plot"

example_colormap_9

=== "C++"

```cpp--8<-- "examples/appearance/colormaps/colormap/colormap_9.cpp"```

Color Bar

colorbar();
See result

example_colorbar_1

More Examples:

example_colorbar_2example_colorbar_3example_colorbar_4example_colorbar_5example_colorbar_6example_colorbar_7

===! "Plot"

example_colorbar_1

=== "C++"

```cpp--8<-- "examples/appearance/colormaps/colorbar/colorbar_1.cpp"```

More Examples:

===! "Plot"

example_colorbar_2

=== "C++"

```cpp--8<-- "examples/appearance/colormaps/colorbar/colorbar_2.cpp"```

===! "Plot"

example_colorbar_3

=== "C++"

```cpp--8<-- "examples/appearance/colormaps/colorbar/colorbar_3.cpp"```

===! "Plot"

example_colorbar_4

=== "C++"

```cpp--8<-- "examples/appearance/colormaps/colorbar/colorbar_4.cpp"```

===! "Plot"

example_colorbar_5

=== "C++"

```cpp--8<-- "examples/appearance/colormaps/colorbar/colorbar_5.cpp"```

===! "Plot"

example_colorbar_6

=== "C++"

```cpp--8<-- "examples/appearance/colormaps/colorbar/colorbar_6.cpp"```

===! "Plot"

example_colorbar_7

=== "C++"

```cpp--8<-- "examples/appearance/colormaps/colorbar/colorbar_7.cpp"```

RGB Plot

rgbplot(colors);
See result

example_rgbplot_1

More Examples:

example_rgbplot_2

===! "Plot"

example_rgbplot_1

=== "C++"

```cpp--8<-- "examples/appearance/colormaps/rgbplot/rgbplot_1.cpp"```

More Examples:

===! "Plot"

example_rgbplot_2

=== "C++"

```cpp--8<-- "examples/appearance/colormaps/rgbplot/rgbplot_2.cpp"```

Camera

View

view(az, el);
See result

example_view_1

More Examples:

example_view_2example_view_3example_view_4example_view_5

===! "Plot"

example_view_1

=== "C++"

```cpp--8<-- "examples/appearance/camera/view/view_1.cpp"```

More Examples:

===! "Plot"

example_view_2

=== "C++"

```cpp--8<-- "examples/appearance/camera/view/view_2.cpp"```

===! "Plot"

example_view_3

=== "C++"

```cpp--8<-- "examples/appearance/camera/view/view_3.cpp"```

===! "Plot"

example_view_4

=== "C++"

```cpp--8<-- "examples/appearance/camera/view/view_4.cpp"```

===! "Plot"

example_view_5

=== "C++"

```cpp--8<-- "examples/appearance/camera/view/view_5.cpp"```

===! "Plot"

example_view_6

=== "C++"

```cpp--8<-- "examples/appearance/camera/view/view_6.cpp"```

Lighting

surf(x, y, z)->lighting(true);
See result

example_lighting_1

More Examples:

example_lighting_2example_lighting_3example_lighting_4example_lighting_5example_lighting_6

===! "Plot"

example_lighting_1

=== "C++"

```cpp--8<-- "examples/appearance/camera/lighting/lighting_1.cpp"```

More Examples:

===! "Plot"

example_lighting_2

=== "C++"

```cpp--8<-- "examples/appearance/camera/lighting/lighting_2.cpp"```

===! "Plot"

example_lighting_3

=== "C++"

```cpp--8<-- "examples/appearance/camera/lighting/lighting_3.cpp"```

===! "Plot"

example_lighting_4

=== "C++"

```cpp--8<-- "examples/appearance/camera/lighting/lighting_4.cpp"```

===! "Plot"

example_lighting_5

=== "C++"

```cpp--8<-- "examples/appearance/camera/lighting/lighting_5.cpp"```

===! "Plot"

example_lighting_6

=== "C++"

```cpp--8<-- "examples/appearance/camera/lighting/lighting_6.cpp"```

Figure Object

figure();
See result

example_figure_1

More Examples:

example_figure_2example_figure_3

===! "Plot"

example_figure_1

=== "C++"

```cpp--8<-- "examples/appearance/figure/figure_1.cpp"```

More Examples:

===! "Plot"

example_figure_2

=== "C++"

```cpp--8<-- "examples/appearance/figure/figure_2.cpp"```

===! "Plot"

example_figure_3

=== "C++"

```cpp--8<-- "examples/appearance/figure/figure_3.cpp"```

Line Specs

fplot(fn, spec_str);
See result

example_line_spec_1

===! "Plot"

example_line_spec_1

=== "C++"

```cpp--8<-- "examples/appearance/line_spec/line_spec_1.cpp"```

Axes Object

auto ax1 = gca();
See result

example_axes_1

More Examples:

example_axes_2example_axes_3

===! "Plot"

example_axes_1

=== "C++"

```cpp--8<-- "examples/appearance/axes/axes_1.cpp"```

More Examples:

===! "Plot"

example_axes_2

=== "C++"

```cpp--8<-- "examples/appearance/axes/axes_2.cpp"```

===! "Plot"

example_axes_3

=== "C++"

```cpp--8<-- "examples/appearance/axes/axes_3.cpp"```

Clear Axes

cla();
See result

example_cla_1

More Examples:

example_cla_2example_cla_3

===! "Plot"

example_cla_1

=== "C++"

```cpp--8<-- "examples/appearance/cla/cla_1.cpp"```

More Examples:

===! "Plot"

example_cla_2

=== "C++"

```cpp--8<-- "examples/appearance/cla/cla_2.cpp"```

===! "Plot"

example_cla_3

=== "C++"

```cpp--8<-- "examples/appearance/cla/cla_3.cpp"```

Exporting

Saving (Manually)

The interactive plot window contains a widget to save the current figure. Because this widget uses the same backend as the one used to produce the interactive image, the final image matches closely what the user sees in the window.

Saving (Programatically)

You can programmatically save the figure in a number of formats with thesave function:

save(filename);

or

save(filename, fileformat);
See result

example_save_1

More Examples:

example_save_2example_save_3example_save_4example_save_5example_save_6example_save_7example_save_8

===! "Plot"

example_save_1

=== "C++"

```cpp--8<-- "examples/exporting/save/save_1.cpp"```

More Examples:

===! "Plot"

example_save_2

=== "C++"

```cpp--8<-- "examples/exporting/save/save_2.cpp"```

===! "Plot"

example_save_3

=== "C++"

```cpp--8<-- "examples/exporting/save/save_3.cpp"```

===! "Plot"

example_save_4

=== "C++"

```cpp--8<-- "examples/exporting/save/save_4.cpp"```

===! "Plot"

example_save_5

=== "C++"

```cpp--8<-- "examples/exporting/save/save_5.cpp"```

===! "Plot"

example_save_6

=== "C++"

```cpp--8<-- "examples/exporting/save/save_6.cpp"```

===! "Plot"

example_save_7

=== "C++"

```cpp--8<-- "examples/exporting/save/save_7.cpp"```

===! "Plot"

example_save_8

=== "C++"

```cpp--8<-- "examples/exporting/save/save_8.cpp"```

The first option (save(filename)) infers the appropriate file format from the filename extension. In both cases (save(filename) andsave(filename,fileformat)), this function temporarily changes the backend to a non-interactive backend appropriate to draw the figure. A different backend is used for each format and, depending on the format, the final image does not necessarily match what is on the interactive plot window. The reason is that some file formats purposefully do not include the same features.

For instance, consider the bar chart generated by

vector<double> x = {29,17,14,13,12,4,11};bar(x);

If we export the image with

save("barchart.svg");

we get the vector graphics

See result

Barchart as SVG file

Exporting the image with

save("barchart.txt");

generates a representation of the image appropriate for text or markdown files, such as

See result
       30 +-----------------------------------------------------------+          |    *******   +       +      +       +      +       +      |          |    *     *                                                |       25 |-+  *     *                                              +-|          |    *     *                                                |          |    *     *                                                |       20 |-+  *     *                                              +-|          |    *     *                                                |          |    *     ********                                         |       15 |-+  *     **     *                                       +-|          |    *     **     * *******                                 |          |    *     **     * *     ******** *******                  |          |    *     **     * *     **     * *     *        *******   |       10 |-+  *     **     * *     **     * *     *        *     * +-|          |    *     **     * *     **     * *     *        *     *   |          |    *     **     * *     **     * *     *        *     *   |        5 |-+  *     **     * *     **     * *     ******** *     * +-|          |    *     **     * *     **     * *     **     * *     *   |          |    *  +  **  +  * *  +  **  +  * *  +  **  +  * *  +  *   |        0 +-----------------------------------------------------------+                  1      2       3      4       5      6       7

As the last example, saving an image with

save("barchart.tex");

would save the image in a format appropriate to embed in latex documents, such as

See result

Barchart - Latex

This exports the image in a format in which the labels are replaced by latex text so that the plot fits the rest of the document.

Coding styles

Member vs. Free-standing Functions

Like in Matplotlib, we support two coding styles: Free-standing functions and an Object-oriented interface.

These two examples would generate the same plot:

=== "Free-standing functions"

```cppauto ax = gca();plot(ax, x, y)->color("red").line_width(2);my_function(ax);```

=== "Object-oriented interface"

```cppauto ax = gca();ax->plot(x, y)->color("red").line_width(2);my_function(ax);```
  • Freestanding functions:

    • We call functions to create plots on the current axes
    • The global currentaxes object is the currentaxes object in the current figure in the global figure registry
    • For instance, one can useplot(y); to create a line plot on the current axes (or create a newaxes object if needed).
    • Also, one can useplot(ax,y); to create a line plot on theaxes objectax.
    • This is less verbose for small projects and quick tests.
    • The library looks for existing axes to create the plot.
  • Object-oriented interface:

    • We explicitly create figures and call methods on them
    • For instance, one can useax->plot(y); to plot on theaxes objectax
    • We can create the same line plot on the current axes byauto ax = gca(); ax->plot(y);
    • This is less verbose and provides better control in large projects where we need to pass these objects around
    • The user manages axes handles containing plots.

All free-standing functions are templated functions that use meta-programming to call the main function on the currentaxes object. If the first parameter is not anaxes_handle, it will get anaxes_handle from the figure registry withgca (SectionAxes Object) and forward all parameters to the function in thisaxes object. If the first parameter is anaxes_handle, the template function will forward all parameters, but the first one, to thisaxes object. This use of templates for the free-standing functions keeps both coding styles maintainable by the developers.

Note that, because the example needs theaxes object for the functionmy_function, we also need to get a reference to theaxes object with the free-standing functions. In that case, the free-standing functions are not less verbose than the object-oriented interface.

To adhere to free-standing functions, we could create two versions ofmy_function: one that receives anaxes_handle, and a second version that would get anaxes_handle from the figure registry and call the first version. Ifmy_function is going to be exposed to other users as a library, this could be a convenience to these users. However, notice that this is only moving the verbosity from the main function tomy_function. In fact, this is how the free-standing functions inMatplot++ work.

Reactive vs. Quiet Figures

There are also two modes for figures: reactive (or interactive) mode and quiet mode.

=== "Reactive mode"

```cpp// Reactive modeauto f = figure(false);auto ax = f->gca();auto p = ax->plot(ax, x, y);   // draws oncep->color("red").line_width(2); // draws twice moreshow();                        // pause console```

=== "Quiet mode"

```cpp// Quiet modeauto f = figure(true);auto ax = f->gca();auto p = ax->plot(x,y);        // does not drawp->color("red").line_width(2); // does not drawf->show();                     // draw only once and pause console```

Figures in reactive mode are updated whenever any of their child objects change. This happens through thetouch function, that gets called on any child object when it changes its appearance. This creates an interactive mode in which figures are updated as soon as we adjust their properties. If we combine interactive figures with free-standing functions, we have a "Matlab-like style" for plots. This is a coding pattern where the figure registry works as a stream for plots. The problem with this coding style is that the user might unnecessarily create useless intermediary plots.

Figures in quiet mode are updated by calling the functionsdraw() orshow() (SectionReactive Figures). Unless these functions are called, nothing changes in the figure. The combination of the object-oriented coding style and quiet mode is the "OO-Matplotlib-like style" for plots. This is a coding style in which the user explicitly decides when the plot is shown or updated. This is beneficial to applications that cannot waste computational resources on intermediary figures that might not be valuable to the application.

We generally use free-standing functions with reactive mode and the object-oriented interface with quiet mode. By default, new figures are in reactive mode, unless it is using an non-interactive backend. One can turn this reactive mode on and off with:

  • ion() orioff() free-standing functions
  • reactive(bool) orquiet(bool) function on thefigure object
  • figure(true) orfigure(false) when explicitly creating a new figure

For convenience, the examples in SectionExamples use the reactive mode. Theshow function pauses the console until the user interacts with the plot window. If the backend is based on process pipes, because these are unidirectional, closing the window is not enough to resume. The user needs to use the console to unblock execution. A similar example is quiet mode would be

In this example, the figure is only updated once. The user could replace theshow function with thedraw function, but the window would close as soon as execution completes. It is important to useshow() with caution. These functions are meant for some particular executables so that an interactive plot does not close before the user can see it. It is probably unreasonable to call these functions inside a library because the user would have to manually interfere with the execution to continue.

Method Chaining

To support a more compact syntax, the library allows method chaining on plot objects. For instance, we can create a simple line plot and modify its appearance by

=== "Object Handle"

```cpp// Using the line handleauto p = plot(x,y,"--gs");p->line_width(2);p->marker_size(10);p->marker_color("b");p->marker_face_color({.5,.5,.5});```

=== "Method Chaining"

```cpp// Method chainingplot(x,y,"--gs")  ->line_width(2)  .marker_size(10)  .marker_color("b")  .marker_face_color({.5,.5,.5});```

The first code snippet works becauseplot returns aline_handle to the object in theaxes. We can use this line handle to modify the line plot. Whenever we modify a property, the setter function callstouch, which willdraw the figure again if it is in reactive mode. The second option works because setters return a reference to*this rather than void.

Ranges

The plotting functions work on any range of elements convertible todouble. For instance, we can create a line plot from a set of elements by

set<int> y = {6,3,8,2,5};plot(y);

Any object that has the functionsbegin andend are considered iterable ranges. Mostaxes object subclasses usevector<double> orvector<vector<double>> to store their data. For convenience, thecommon.h header file includes the aliasesvector_1d andvector_2d to these data types.

These conversions also work on ranges of ranges:

vector<set<int>> Y = { {6,3,8,2,5}, {6,3,5,8,2} };plot(Y);

Unfortunately, because of how templated functions work, one exception is initializer lists. Initializer lists only work for functions that are explicitly defined for them.

Common Utilities

The headerscommon.h andcolors.h include a number of utilities we use in our examples. These include naive functions to:

  • generate and manipulate vectors and strings;
  • handle RGBA color arrays;
  • convert points to and from polar coordinates;
  • read files to strings;
  • write strings to files;
  • calculate gradients;
  • read, write, and manipulate images;
  • and generate vectors with random numbers.

Although some of these functions might be helpful, most functions only operate onstd::vector<double> and they are not intended to be a library of utilities. The sole purpose of these algorithms is to simplify the examples.

Backends

This library currently include a GnuPlot backend and an experimental OpenGL backend. Coming up with new backends is a continuous process. See the completearticle for a description of thebackend interface, a description of the current default backend (Gnuplot pipe), and what's involved in possiblenew backends. See the directorysource/matplot/backend for some examples. Also, have a look at this exampletest/backends/main.cpp.

If you're in a hurry, here is a summary of the backends we have and the backends we have been considering or are working on:

  • Gnuplot
    • Pros: It seems to be working for everyone.
    • Cons: Pipes are comparatively slow and unidirectional
    • In practice, this is default backend you'll get right now.
  • OpenGL
    • Pros: Efficient for many FPS.
    • Cons: Blocks the main thread on some operating systems
    • The experimental OpenGL backend already works for some plot categories.see1
  • Qt
    • Same as OpenGLsee1,2
  • AGG
    • Pros: Great for vector graphics
    • Cons: Unmaintained, 2D only, and non-interactive by itselfsee1,2,3

Motivation and Details

If you are interested in understanding how the library works, you can read the details in the completearticle. It describes the relationship between its main objects, the backend interface, how to create new plot categories, its limitations, and compares this library with similar alternatives.

Community

Get Involved

  • After getting started with this library, please complete thissurvey to let us know how we can improve your experience.
  • Discussions are concentrated on our GitHubdiscussions page. Don't refrain from asking questions and proposing ideas. If this library helps you create something interesting, please divulge it with the community.
  • If you are a programmer with good ideas, pleaseshare these ideas with us.
  • Academic collaboration is more than welcome. It'd be great to see this library help people write lots and lots of academic papers.

Ideas and Roadmap

Feel free to contribute with new features to this library. For complex features and changes, considergetting feedback from the community first. Contributing to an existing code base with its own conventions might seem intricate at first but please don't let that discourage you from sharing your ideas.

There are many ways in which you can contribute to this library:

  • Testing the library in new environmentssee1,2,3
  • Contributing with interesting examplessee1
  • Designing new backendssee1,2,3,4
  • Finding problems in this documentationsee1
  • Writing algorithms for new plot categoriessee1
  • Finding bugs in generalsee1,2,3,4
  • Whatever idea seems interesting to you

The only thing we ask you is to make sure your contribution is not destructive. Some contributions in which we are not interested are:

  • "I don't like this optional feature so I removed/deprecated it"
  • "I removed this feature to support older versions of C++" but have not provided an equivalent alternative
  • "I removed this feature so I don't have to install/update ______" but have not provided an equivalent alternative
  • "I'm creating this high-cost promise that we'll support ________ forever" but I'm not sticking around to keep that promise

In doubt, please open adiscussion first

Contributing Guidelines

If contributing with code, please leave the OpenGL backend and pedantic mode ON (-DMATPLOTPP_BUILD_EXPERIMENTAL_OPENGL_BACKEND=ON -DMATPLOTPP_BUILD_WITH_PEDANTIC_WARNINGS=ON), usecppcheck, andclang-format.

Example: CLion

CLion Settings with Pedantic Mode

If contributing to the documentation, please editREADME.md directly, as the files in./docs are automatically generated withmdsplit.

Contributors

alandefreitas
Alan De Freitas
mrexodia
Duncan Ogilvie
lacc97
Luis CC!ceres
matthew-hennefarth
Matthew-hennefarth
actions-user
Actions-user
aminya
Amin Yahyaabadi
j0hnnybash
J0hnnybash
leha-bot
Alex
rath3t
Rath3t
xnorpx
Marcus Asteborg
edvinsmineikis
Edvins Mineikis
codeinred
Alecto Irene Perez
gitplcc
Gitplcc
madronalabs
Randy Jones
sammi
Sammi
acxz
Akash Patel
aalbaali
Amro Al-Baali
avocadoboi
BjC6rn Sundin
csernib
BC!lint Cserni
david-x64
David
dimztimz
Dimitrij Mijoski
saxbophone
Joshua Saxby
MaBnt
MaBnt
globberwops
Martin Stump
Morwenn
Morwenn
kaffehalv
Niclas Wall Wennerdal
RTrioux
RTrioux
solosuper
Solo Super
TheGreatRambler
TheGreatRambler
ankane
Andrew Kane
wwinslade
William Winslade

We would also like to thankThe Icculus Microgrant.

References

These are some references we used for this work:

  • Abadi M, Barham P, Chen J, Chen Z, Davis A, Dean J, Devin M, Ghemawat S, Irving G,Isard M,et al.(2016). "Tensorflow: A system for large-scale machine learning." In 12th USENIX symposium on operating systems design and implementation (OSDI 16), pp.265-283.

  • Angerson E, Bai Z, Dongarra J, Greenbaum A, McKenney A, Du Croz J, Hammarling S,Demmel J, Bischof C, Sorensen D (1990). "LAPACK: A portable linear algebra library for high-performance computers." In Supercomputing'90: Proceedings of the 1990 ACM/IEEE Conference on Supercomputing, pp. 2-11. IEEE.

  • Antcheva I, Ballintijn M, Bellenot B, Biskup M, Brun R, Buncic N, Canal P, Casadei D, CouetO, Fine V, et al.(2011). "ROOT-A C++ framework for petabyte data storage, statistical analysis and visualization."Computer Physics Communications,182(6), 1384-1385.

  • Baratov R (2019). Hunter. URL:https://hunter.readthedocs.io.

  • Barrett P, Hunter J, Miller JT, Hsu JC, Greenfield P (2005). "matplotlib-A Portable Python Plotting Package." In Astronomical data analysis software and systems XIV, volume 347,p. 91.

  • Bezanson J, Edelman A, Karpinski S, Shah VB (2017). "Julia: A fresh approach to numerical computing. "SIAM review,59(1), 65-98.

  • CEGUI Team (2020). CEGUI. URL:http://cegui.org.uk.

  • Cornut O (2020). Dear ImGui: Bloat-free Immediate Mode Graphical User Interface for C++ with minimal dependencies. URL:https://github.com/ocornut/imgui.

  • de Guzman J (2020). Elements. URL:http://cycfi.github.io/elements/.

  • Eichhammer E (2020). QCustomPlot. URL:https://www.qcustomplot.com.

  • Evers B (2019). Matplotlib-cpp. URL:https://github.com/lava/matplotlib-cpp.

  • Freitas A (2020). Pareto Front Library. URL:https://github.com/alandefreitas/pareto-front.

  • Frigo M, Johnson SG (1998). "FFTW: An adaptive software architecture for the FFT." In Proceedings of the 1998 IEEE International Conference on Acoustics, Speech and Signal Processing, ICASSP'98 (Cat. No. 98CH36181), volume 3, pp. 1381-1384. IEEE.

  • Fruchterman TM, Reingold EM (1991). "Graph drawing by force-directed placement. "Software: Practice and experience, 21(11), 1129-1164.

  • GNU Project (2020). GNU Octave: Introduction to Plotting. URL:https://octave.org/doc/v4.2.2/Introduction-to-Plotting.html.

  • Guy Eric Schalnat Andreas Dilger GRP (2020). Libpng. URL:https://sourceforge.net/p/libpng/.

  • Hao J (2020). Nana. URL:http://nanapro.org/.

  • Hunter JD (2007). "Matplotlib: A 2D graphics environment. "Computing in Science & Engineering, 9(3), 90-95. doi:10.1109/MCSE.2007.55.

  • Idea4good (2020). GuiLite. URL:https://github.com/idea4good/GuiLite.

  • ImageMagick Studio LLC (2020). Magick++. URL:https://imagemagick.org/Magick++/.

  • Independent JPEG Group (2020). Libjpeg. URL:http://libjpeg.sourceforge.net.

  • Intel Corporation, Willow Garage I (2020). Open Source Computer Vision Library (OpenCV). URL:https://opencv.org/.

  • Jakob W (2017). PyBind11. URL:https://pybind11.readthedocs.io/en/stable/.

  • Kagstrom B LP, C VL (2020). Basic Linear Algebra Subprograms (BLAS). URL:http://www.netlib.org/blas/.

  • Kainz F, Bogart R, Hess D (2003). "The OpenEXR image file format."SIGGRAPH TechnicalSketches.

  • Kamada T, Kawai S,et al.(1989). "An algorithm for drawing general undirected graphs."Information processing letters,31(1), 7-15.

  • Loup Gailly J, Adler M (2020). Zlib. URL:https://github.com/madler/zlib.

  • Martin K, Hoffman B (2010). Mastering CMake: a cross-platform build system. Kitware.

  • McKinney W,et al.(2011). "Pandas: a foundational Python library for data analysis and statistics. "Python for High Performance and Scientific Computing, 14(9).

  • Conan.io (2020). Conan. URL:https://conan.io.

  • Melchior L (2020). CPM.cmake. URL:https://github.com/TheLartians/CPM.cmake.

  • Murray Cumming DE (2020). Gtkmm. URL:https://www.gtkmm.org/.

  • Natural Earth (2018). "Natural earth. Free vector and raster map data." URL:http://www.naturalearthdata.com/downloads/.

  • NetworkX developers (2020). NetworkX. URL:https://networkx.github.io.

  • Olivier Birot (2020). nodesoup. URL:https://github.com/olvb/nodesoup.

  • Pezent E (2020). ImPlot. URL:https://github.com/epezent/implot.

  • Sam Leffler SG (2020). Libtiff. URL:https://gitlab.com/libtiff/libtiff.

  • Schaling B (2011). The boost C++ libraries. Boris Schaling.

  • Spitzak B, et al.(2004). "Fast Light Toolkit (FLTK)." FTLK: Fast light toolkit. Available:http://www.fltk.org/

  • Stahlke D (2020). Gnuplot-Iostream. URL:http://stahlke.org/dan/gnuplot-iostream/.

  • Storer J (2020). JUCE. URL:https://juce.com.

  • Terra Informatica Software, Inc (2020). Sciter. URL:https://sciter.com.

  • The FLTK Team (2020). FLTK. URL:https://www.fltk.org.

  • The MathWorks, Inc (2020). MatlabGraphics. URL:https://www.mathworks.com/help/matlab/graphics.html.

  • The Qt Company (2020). Qt. URL:https://www.qt.io.

  • Tschumperle D (2020). CImg. URL:http://cimg.eu.

  • van der Zijp J (2020). Fox toolkit. URL:http://fox-toolkit.org.

  • Vasilev V, Canal P, Naumann A, Russo P (2012). "Cling-the new interactive interpreter for root 6." In Journal of Physics: Conference Series, volume 396, p. 052071.

  • Walt Svd, Colbert SC, Varoquaux G (2011). "The NumPy array: a structure for efficient numerical computation." Computing in science & engineering,13(2), 22-30.

  • Wei V (2020). MiniGUI. URL:http://www.minigui.com.

  • Williams T, Kelley C, Bersch C, Broker HB, Campbell J, Cunningham R, Denholm D, Elber G, Fearick R, Grammes C,et al.(2017). "gnuplot 5.2."

  • wxWidgets (2020). WxWidgets. URL:https://wxwidgets.org.

  • XOrg Foundation (2020). X11. URL:https://www.x.org/.

  • Zaitsev S (2020). Webview. URL:https://github.com/zserge/webview.

  • Zakai A (2011). "Emscripten: an LLVM-to-JavaScript compiler." In Proceedings of the ACM international conference companion on Object oriented programming systems languages and applications companion, pp. 301-312.


[8]ページ先頭

©2009-2025 Movatter.jp