Git Product home page Git Product logo

untplot's Introduction

UntPlot: UntPhesoca调值格局可视化图的Python绘图包

该可视化方案及配色方案均来自UntPhesoca发表在第十四届**语音学学术会议(PCC 2021)上的《一种直观的调值格局可视化方法》,海报可见unt的知乎专栏unt的个人网站重庆实例图

使用方法

重庆格局的实例已经在test.py中给出,详见该文件。

  • 引入包:

from unt_plot import UntPlot

  • 实例化:

up = UntPlot()

此处可传入figsizegrid_color两个参数指明画布大小与网格颜色,默认值为(14,14),'grey'

  • 添加一条声调演化路径:

up.create_path(text="阴", path=["44", "55", "45"], color="阴平")

UntPlot类的方法create_path()函数接受以下参数:

  • text: 标注文字

  • path: 一个string组成的list,每个string是五度值调值,可以为曲折调,但不接受双折调

  • color: 可以使用给每个调类的预设颜色,不分阴阳的调类请随意选取一个。也可以直接传入「金茶草柳蔚靛雪墨」中的一种,或任何matplotlib接受的颜色字符串(如:'red''"#FDCD00"'),不传入此参数,则依次在上述颜色种循环使用

  • 保存图片:

up.fig.savefig('file.png')

可以分别通过up.figup.ax获取图片的matplotlib.Figurematplotlib.Axes对象。

技术细节

unt_plot.py中定义了两个类UntPlotBaseUntPlot,后者是前者的子类,可以调用父类方法实现更底层的操作。

untplot's People

Contributors

fncokg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.