matplotlib实现热成像图colorbar和极坐标图的方法
2019-01-29 12:43
1616 查看
热成像图
%matplotlib inline from matplotlib import pyplot as plt import numpy as np def f(x, y): return (1 - x / 2 + x ** 5 + y ** 3) * np.exp(-x ** 2 - y ** 2) n = 10 x = np.linspace(-3, 3, 4 * n) y = np.linspace(-3, 3, 3 * n) X, Y = np.meshgrid(x, y) plt.imshow(f(X, Y), cmap='hot', origin='low') plt.colorbar(shrink=.83) plt.xticks(()) plt.yticks(())
极坐标图
%matplotlib inline from matplotlib import pyplot as plt import numpy as np ax = plt.subplot(1, 1, 1, polar=True) #ax = plt.plot( polar=True) N = 20 theta = np.arange(0.0, 2 * np.pi, 2 * np.pi / N) radii = 10 * np.random.rand(N) width = np.pi / 4 * np.random.rand(N) bars = plt.bar(theta, radii, width=width, bottom=0.0) for r,bar in zip(radii, bars): bar.set_facecolor(plt.cm.jet(r/10.)) bar.set_alpha(0.5) ax.set_xticklabels([]) ax.set_yticklabels([])
以上这篇matplotlib实现热成像图colorbar和极坐标图的方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。
相关文章推荐
- Python实现matplotlib显示中文的方法详解
- Python实现在matplotlib中两个坐标轴之间画一条直线光标的方法
- Python实现在tkinter中使用matplotlib绘制图形的方法示例
- 对matplotlib改变colorbar位置和方向的方法详解
- Python实现在matplotlib中两个坐标轴之间画一条直线光标的方法
- Python使用Matplotlib实现雨点图动画效果的方法
- Python使用matplotlib实现在坐标系中画一个矩形的方法
- Python使用matplotlib实现在坐标系中画一个矩形的方法
- 演示如何实现Matplotlib绘图并保存图像但不显示图形的方法
- 演示如何实现Matplotlib绘图并保存图像但不显示图形的方法
- PyQt+matplotlib界面简单实现
- python安装numpy、scipy和matplotlib等whl包的方法
- matplotlib中文乱码解决方法
- python3.X安装matplotlib简单方法
- matplotlib中文乱码解决方法
- Matplotlib.pyplot 常用方法(二)
- python3.3+numpy+matplotlib 实现绘图
- python实现Kmeans文本聚类,通过PCA降维和Matplotlib显示聚类3d三维图像
- Windows64 系Python、NumPy与matplotlib 安装方法
- matplotlib极坐标方法详解