Skip to main content

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)

Metadata

Release files for ltoolx 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ltoolx 0.1.5
File Size Uploaded
ltoolx-0.1.5.tar.gz 6.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ltoolx 0.1.5
File Interpreter ABI Platform
ltoolx-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 14.4 kB

Release files / ltoolx-0.1.5.tar.gz

Download URL ltoolx-0.1.5.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ce0eea12fd6f1d57da767486b16e567b0739ebbf6e079aacfe00b7c374513a5f
BLAKE2b-256 checksum
How to use checksums
7c6f6b11beeae26458d0f5a60955739141465bcc22b3fa56aa0399f415677072
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"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}

Release files / ltoolx-0.1.5-py3-none-any.whl

Download URL ltoolx-0.1.5-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
93f5b80cf32e296a3487940373c80e30f115d61dfd4262ee8efa525f3d604bb4
BLAKE2b-256 checksum
How to use checksums
18b72d23788a1d00db14c5928a118b5fc40db090fa8be2024abc98e3898581fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"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}

Release history Release notifications | RSS feed

This release

0.1.5 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page