Python+matplotlib实现华丽的文本框演示代码

yipeiwu_com6年前Python基础

华丽的文本框演示

首先看看演示结果:

实现代码

import matplotlib.pyplot as plt

plt.text(0.8, 0.5, "python", size=50, rotation=30.,
   ha="center", va="center",
   bbox=dict(boxstyle="round",
     ec=(1., 0.5, 0.5),
     fc=(1., 0.8, 0.8),
     )
   )

plt.text(0.75, 0.6, "www.jb51.net", size=50, rotation=-30.,
   ha="right", va="top",
   bbox=dict(boxstyle="square",
     ec=(1., 0.5, 0.5),
     fc=(1., 0.8, 0.8),
     )
   )


plt.draw()
plt.show()

总结

以上就是本文关于Python+matplotlib实现华丽的文本框演示代码的全部内容,希望对大家有所帮助。感兴趣的朋友可以继续参阅本站其他相关专题,如有不足之处,欢迎留言指出。感谢朋友们对本站的支持!

相关文章

python获取交互式ssh shell的方法

更新,最近在学unix环境编程,了解一下进程的创建过程,用最原始的方式实现了一个ssh命令的执行。 #coding=utf8 ''' 用python实现了一个简单的shell,了...

在Python中通过threading模块定义和调用线程的方法

定义线程 最简单的方法:使用target指定线程要执行的目标函数,再使用start()启动。 语法: class threading.Thread(group=None, targe...

python中subprocess批量执行linux命令

可以执行shell命令的相关模块和函数有: os.system os.spawn os.popen --废弃 popen --废弃 commands --废弃,3....

python根据距离和时长计算配速示例

复制代码 代码如下:function cal_pace(d,h,m,s){ var distance = d; var hours = h; var min...

Python读取系统文件夹内所有文件并统计数量的方法

大家先看一下Python os模块中的部分函数 python 路径相关的函数 os.listdir(dirname):列出dirname下的目录和文件 os.getcwd():获得当前...