Common tool packaging
Project description
Introduction
L2的妙妙工具包,包含gurobi、matplot相关函数。
Matplotlib tools
提供更为强大的svg矢量图导出功能,完整功能需要结合axisartist使用。
在plot选项当中添加gid="out"参数,将折线线段化,并剔除超出坐标轴的图线,实现图像在ppt、visio等工具当中的更多编辑功能。
使用示例如下:
from ltoolx.matplotlib_utils import *
from ltoolx.svg_utils import *
import mpl_toolkits.axisartist as AA
# plt直接使用方法
plt.axes(axes_class=AA.Axes)
plt.plot([1, 2, 3], [3, 5, 4], label="inax", marker="s")
plt.plot(
[1, 2, 3], [5, 15, 3], gid="out", label="outax", linestyle="--", marker="o"
)
plt.xlim([1.25, 3])
plt.ylim([4.0, 10.0])
plt.legend()
savefig("test1.svg")
# 创建figure对象使用方法
fig= plt.figure()
ax = fig.add_subplot(axes_class=AA.Axes)
ax.plot([1,2,3],[3,2,4],label='inax')
ax.plot([1,2,3],[5,15,3],label='outax',gid='out')
ax.set_ylim([0,10])
ax.legend()
Fig(fig).savefig("test2.svg")
导出为vsd并保存到剪切板
from ltoolx.matplotlib_utils import *
from ltoolx.svg_utils import *
# plt直接使用方法
plt.plot([1, 2, 3], [3, 5, 4], label="inax", marker="s")
plt.plot(
[1, 2, 3], [5, 15, 3], gid="out", label="outax", linestyle="--", marker="o"
)
plt.xlim([1.25, 3])
plt.ylim([4.0, 10.0])
plt.legend()
savefig("test1.svg").to_vsd(clipboard=True)
# 创建figure对象使用方法
fig= plt.figure()
ax = fig.add_subplot(axes_class=AA.Axes)
ax.plot([1,2,3],[3,2,4],label='inax')
ax.plot([1,2,3],[5,15,3],label='outax',gid='out')
ax.set_ylim([0,10])
ax.legend()
Fig(fig).savefig("test2.svg").to_vsd(clipboard=True)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ltoolx-0.1.4.tar.gz
(84.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ltoolx-0.1.4.tar.gz.
File metadata
- Download URL: ltoolx-0.1.4.tar.gz
- Upload date:
- Size: 84.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
893dcdfeb8b5fd9b3b4025e719955e6a0f4b03273fcc4cd9a11e91516ce8b03d
|
|
| MD5 |
39627503ca3cc4c0a54ad09a622ab3fc
|
|
| BLAKE2b-256 |
86461676b339de295d9aaf913ea58c884b3d80c1db6d28937118a6a3377a5c20
|
File details
Details for the file ltoolx-0.1.4-py3-none-any.whl.
File metadata
- Download URL: ltoolx-0.1.4-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe2f2612211efeb8a76f906ec9dea8e124e396824cda01a43d1c5092c72a009f
|
|
| MD5 |
ddcbdd46e19c59d9736743a50e14b654
|
|
| BLAKE2b-256 |
435ee4de53cb65371493e06aee57bf67c6a65f9811f1ffaf1e4eb51421557a44
|