目录

DataViz

DataViz helps you to create plots quickly. You declare what information (the data source) to display and how to display it (the plot type and style). DataViz tries to be as close as possible to the Vega-Lite visualization grammar. Available backends for plotting are matplotlib and bokeh.

Installation

Install via pip:

$ pip install dataviz

Example

To display a plot in Jupyter notebook:

import dataviz as dv

spec = {
    "width": 600,
    "height": 300,

    "data": {
        "values": [
            {"time": "2021-01-01", "value": 28},
            {"time": "2021-01-02", "value": 55},
            {"time": "2021-01-03", "value": 43},
            {"time": "2021-01-04", "value": 91},
            {"time": "2021-01-05", "value": 81},
            {"time": "2021-01-06", "value": 53},
        ]
    },
    "mark": "line",
    "encoding": {
        "x": {"field": "time", "type": "temporal"},
        "y": {"field": "value", "type": "quantitative"},
        "color": {"value": "red"},
    }
}

fig = dv.figure(spec, 'matplotlib')
fig.show()

This will produce the following plot:

Contribute

To learn more on how to successfully contribute please read the contributing information in the LibreCube guidelines.

Support

If you are having issues, please let us know. Reach us at Matrix or via Email.

License

The project is licensed under the MIT license. See the LICENSE file for details.

关于

LibreCube(开源教育卫星与组件平台)开源仓库 python-dataviz。镜像收录自 https://gitlab.com/librecube/lib/python-dataviz,License:以源仓库 LICENSE 为准(MIT / CERN-OHL 等)

117.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802047560号