mpld3

Matplotlib 图形的 D3 渲染。(D3 Renderings of Matplotlib Graphics)

  • 所有者: mpld3/mpld3
  • 平台: Linux, Mac, Windows
  • 許可證: BSD 3-Clause "New" or "Revised" License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

mpld3: A D3 Viewer for Matplotlib

Note: mpld3 is in the process of switching maintainers: feature requests & bug reports are likely to be delayed. If you are interested in contributing to this project, please contact one of the repository owners.


This is an interactive D3js-based viewer which brings matplotlib graphics to the browser.
Please visit http://mpld3.github.io for documentation and examples.

You may also see the blog post, or the
IPython notebook examples
available in the notebooks directory of this repository.

version status
downloads
build status

About

mpld3 provides a custom stand-alone javascript library built on D3, which
parses JSON representations of plots. The mpld3 python module provides a
set of routines which parses matplotlib plots (using the
mplexporter framework) and outputs
the JSON description readable by mpld3.js.

Installation

mpld3 is compatible with python 2.6-2.7 and 3.3-3.4. It requires
matplotlib version 1.3 and
jinja2 version 2.7+.

Optionally, mpld3 can be used with IPython notebook,
and requires IPython version 1.x or (preferably) version 2.0+.

This package is based on the mplexporter
framework for crawling and exporting matplotlib images. mplexporter is bundled
with the source distribution via git submodule.

Within the git source directory, you can download the mplexporter dependency
and copy it into the mpld3 source directory using the following command:

[~]$ python setup.py submodule

The submodule command is not necessary if you are installing from a distribution
rather than from the git source.

Once the submodule command has been run, you can build the package locally using

[~]$ python setup.py build

or install the package to the standard Python path using:

[~]$ python setup.py install

Or, to install to another location, use

[~]$ python setup.py install --prefix=/path/to/location/

Then make sure your PYTHONPATH environment variable points to this location.

Trying it out

The package is pure python, and very light-weight. You can take a look at
the notebooks in the examples directory, or run create_example.py, which
will create a set of plots and launch a browser window showing interactive
views of these plots.

For a more comprehensive set of examples, see the
IPython notebook examples available in the notebooks directory.

Test Plots

To explore the comparison between D3 renderings and matplotlib renderings for
various plot types, run the script visualize_tests.py. This will generate
an HTML page with the D3 renderings beside corresponding matplotlib renderings.

Features

Many of the core features of matplotlib are already supported. And additionally
there is some extra interactivity provided via the plugin framework. The
following is a non-exhausive list of features that are yet to be supported:

  • tick specification & formatting
  • some legend features
  • blended transforms, such as those required by axvlines and axhlines
  • twin axes (i.e. multiple scales on one plot) tied together

If any of these look like something you'd like to tackle, feel free to submit
a pull request!

主要指標

概覽
名稱與所有者mpld3/mpld3
主編程語言Jupyter Notebook
編程語言Makefile (語言數: 5)
平台Linux, Mac, Windows
許可證BSD 3-Clause "New" or "Revised" License
所有者活动
創建於2013-12-18 01:48:30
推送於2025-05-03 11:23:45
最后一次提交2024-10-30 12:23:10
發布數11
最新版本名稱v0.5.10 (發布於 2023-12-23 13:02:07)
第一版名稱v0.0.1 (發布於 )
用户参与
星數2.4k
關注者數82
派生數364
提交數890
已啟用問題?
問題數363
打開的問題數214
拉請求數128
打開的拉請求數9
關閉的拉請求數33
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?