Metadata-Version: 2.4
Name: ltoolx
Version: 0.1.5
Summary: Common tool packaging
Project-URL: Homepage, https://github.com/jchliao/ltoolx
Project-URL: Repository, https://github.com/jchliao/ltoolx
Author: jchl, riverflows2333
License: Copyright (c) 2018 The Python Packaging Authority
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Requires-Python: >=3.12
Requires-Dist: beautifulsoup4
Requires-Dist: gurobipy
Requires-Dist: ipython
Requires-Dist: lxml
Requires-Dist: matplotlib
Requires-Dist: matplotlib-inline
Requires-Dist: numpy
Requires-Dist: pywin32; sys_platform == 'win32'
Description-Content-Type: text/markdown

# Introduction

L2的妙妙工具包，包含gurobi、matplot相关函数。

## Matplotlib tools

提供更为强大的svg矢量图导出功能，完整功能需要结合axisartist使用。
在plot选项当中添加`gid="out"`参数，将折线线段化，并剔除超出坐标轴的图线，实现图像在ppt、visio等工具当中的更多编辑功能。

使用示例如下：

```python
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并保存到剪切板

```python
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)

```