终端中的绘图点
terminalplot的Python项目详细描述
TerminalPlot是一个极简包装,只打印点 到终点站。它没有任何依赖项。
安装
pip install terminalplot
用法
命令行
获取终端模拟器(TTY)的大小:
$ plot -s Rows: 25, Columns: 80
绘制一些点:
$ plot -x '-1 0 1 2 3 4' -y '0.1 0.2 0.23 0.234 0.24'
api
绘制图形
fromterminalplotimportplotx=range(100)y=[i**2foriinx]plot(x,y)
获取当前终端窗口的大小
fromterminalplotimportget_terminal_sizeget_terminal_size()