mpl-interactions 项目教程

mpl-interactions 项目教程

mpl-interactionsSliders to control matplotlib and other interactive goodies. Works in any interactive backend and even uses ipywidgets when in a Jupyter notebook项目地址:https://gitcode.com/gh_mirrors/mp/mpl-interactions

1. 项目的目录结构及介绍

mpl-interactions/
├── LICENSE
├── README.md
├── setup.py
├── mpl_interactions/
│   ├── __init__.py
│   ├── controller.py
│   ├── deprecations.py
│   ├── generic.py
│   ├── pyplot.py
│   ├── utils.py
│   ├── widgets.py
│   ├── examples/
│   │   ├── basic_example.py
│   │   ├── heatmap_slicer.py
│   │   ├── zooming_panning.py
│   │   └── ...
│   └── tests/
│       ├── test_controller.py
│       ├── test_deprecations.py
│       ├── test_generic.py
│       ├── test_pyplot.py
│       ├── test_utils.py
│       ├── test_widgets.py
│       └── ...
└── docs/
    ├── conf.py
    ├── index.rst
    ├── installation.rst
    ├── usage.rst
    └── ...

目录结构介绍

  • LICENSE: 项目的开源许可证文件。
  • README.md: 项目的介绍和使用说明。
  • setup.py: 项目的安装脚本。
  • mpl_interactions/: 项目的主要代码目录。
    • init.py: 模块初始化文件。
    • controller.py: 控制器相关代码。
    • deprecations.py: 废弃功能相关代码。
    • generic.py: 通用功能相关代码。
    • pyplot.py: Matplotlib 的交互功能实现。
    • utils.py: 工具函数。
    • widgets.py: 交互控件相关代码。
    • examples/: 示例代码目录,包含多个示例脚本。
    • tests/: 测试代码目录,包含多个测试脚本。
  • docs/: 项目文档目录,包含配置文件和文档文件。

2. 项目的启动文件介绍

项目的启动文件主要是 setup.py,它是一个标准的 Python 安装脚本,用于安装和配置项目。通过运行 python setup.py install 可以安装项目及其依赖项。

3. 项目的配置文件介绍

项目的配置文件主要有两个:

  • setup.py: 用于配置项目的安装选项、依赖项和元数据。
  • docs/conf.py: 用于配置项目的文档生成选项,如 Sphinx 文档生成器的配置。

setup.py

setup.py 文件的主要内容包括:

from setuptools import setup, find_packages

setup(
    name='mpl_interactions',
    version='0.24.1',
    description='Easy interactive Matplotlib plots',
    long_description=open('README.md').read(),
    long_description_content_type='text/markdown',
    author='Ian Hunt-Isaak',
    author_email='ianhuntisaak@gmail.com',
    url='https://github.com/mpl-extensions/mpl-interactions',
    packages=find_packages(),
    install_requires=[
        'matplotlib',
        'numpy',
        'ipywidgets',
        'ipympl',
    ],
    extras_require={
        'jupyter': ['jupyterlab', 'notebook'],
    },
    classifiers=[
        'Development Status :: 4 - Beta',
        'Intended Audience :: Developers',
        'Intended Audience :: Science/Research',
        'License :: OSI Approved :: BSD License',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
        'Programming Language :: Python :: 3.8',
        'Programming Language :: Python :: 3.9',
        'Programming Language :: Python :: 3.10',
    ],
)

docs/conf.py

docs/conf.py 文件的主要内容包括:

import os
import sys

sys.path.insert(0, os.path.abspath('..'))

project = 'mpl_interactions'
copyright = '2023, Ian Hunt-Isaak'
author = 'Ian Hunt-Isaak'

extensions = [
    'sphinx.ext.autodoc',
    'sphinx.ext.napoleon',
    'sphinx.ext.viewcode',
]

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

html_theme = 'alabaster'
html_static_path = ['_static']

以上是 mpl-interactions 项目的基本教程,涵盖了项目的目录结构、启动文件和配置文件的介绍。

mpl-interactionsSliders to control matplotlib and other interactive goodies. Works in any interactive backend and even uses ipywidgets when in a Jupyter notebook项目地址:https://gitcode.com/gh_mirrors/mp/mpl-interactions

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

晏其潇Aileen

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值