![]() |
XLPack for Matplotlib Experimental Version 0.1
Reference Manual
|
XLPack for Matplotlib (hereinafter abbreviated as XLPack MPL) is a library program that enables calling Python’s Matplotlib from Excel VBA.
It maps the main Python classes and methods of Matplotlib to VBA classes and methods, allowing Matplotlib to be used entirely within VBA programs.
This program is currently under experimental development as the visualization component of a system that, in combination with the numerical computation library XLPack, performs everything from calculations to result display within Excel.
At present, only some classes and methods have been implemented. As of now, the following classes are available.
PyObject <-+- Figure
+- Axs
+- Axs3d
+- Animation <- ArtistAnimation
Pyplot
Python
PyObject serves as the base class for objects such as Figure.
The classes Axs and Axs3d correspond to Axes and Axes3D in Matplotlib.
The Python class provides methods for common settings and configurations.
Some methods in the original Matplotlib may return objects other than Figure, Axs, Axs3d or Animation (for example, Line2D). However, if there is no need to explicitly use returned objects, the parent class PyObject is returned instead. If necessary in the future, such objects may be added as derived classes of PyObject.
Since Pyplot and Python are not static classes due to VBA specifications, it is necessary to create an object before calling their methods.
KwArgs, which appears as an argument in many methods, represents optional keyword parameters. These are interpreted not by Python, but by this program itself. Therefore, they are not fully supported, and the values that can be used are limited to the following:
Matplotlib provides a very large number of keyword parameters, and since not all of them have been verified, some may not function correctly.
The examples are created by translating Python examples from the following website into VBA:
Matplotlib: https://matplotlib.org/
Some commonly used declarations are omitted in the examples. These are mainly intended to simulate NumPy functions; for the actual code, please refer to the common declarations in the example collection.