Python自定义简单图轴简单实例,python自定义
Python自定义简单图轴简单实例,python自定义
简单定义图轴:
import numpy as np import matplotlib.pyplot as plt
创建一个简单的matplotlib实例:
fig = plt.figure() rect = fig.patch # a rectangle instance rect.set_facecolor('lightgoldenrodyellow') ax1 = fig.add_axes([0.1, 0.3, 0.4, 0.4]) rect = ax1.patch rect.set_facecolor('lightslategray') for label in ax1.xaxis.get_ticklabels(): # label is a Text instance label.set_color('red') label.set_rotation(45) label.set_fontsize(16) for line in ax1.yaxis.get_ticklines(): # line is a Line2D instance line.set_color('green') line.set_markersize(25) line.set_markeredgewidth(3) plt.show()
效果展示:
脚本运行时间:(0分0.021秒)
总结
以上就是本文关于Python自定义简单图轴简单实例的全部内容,希望对大家有所帮助。感兴趣的朋友可以继续参阅本站其他相关专题,如有不足之处,欢迎留言指出。感谢朋友们对本站的支持!
相关内容
- 浅谈Matplotlib简介和pyplot的简单使用——文本标注和箭头
- Python中摘要算法MD5,SHA1简介及应用实例代码,pythonsh
- python的Tqdm模块的使用,pythontqdm模块
- 简单了解python模块概念,python模块概念
- 快速了解Python中的装饰器,Python装饰器
- Python用sndhdr模块识别音频格式详解,pythonsndhdr
- 聊聊Python中的pypy,聊聊Pythonpypy
- python opencv实现任意角度的透视变换实例代码,pythonop
- selenium python浏览器多窗口处理代码示例,seleniumpython
- python逆向入门教程,python入门教程
评论关闭