博客
关于我
python matplotlib contour画等高线图
阅读量:123 次
发布时间:2019-02-26

本文共 545 字,大约阅读时间需要 1 分钟。

Matplotlib??????

1. ???????

import numpy as npimport matplotlib.pyplot as plt

2. ?????????

step = 0.01x = np.arange(-10, 10, step)y = np.arange(-10, 10, step)

3. ??????

X, Y = np.meshgrid(x, y)

4. ???????????

Z = -(X**2 + Y**2)

5. ?????

contourf = plt.contourf(X, Y, Z, levels=6, cmap='hot')

6. ??????????

contour = plt.contour(X, Y, Z, levels=8, colors='k')plt.clabel(contour, fontsize=10, colors='k')

7. ???????

plt.xticks([])plt.yticks([])

8. ?????

plt.colorbar(contourf)

9. ????

plt.show()

???????Matplotlib???????????-10?10?????????????????

转载地址:http://uiof.baihongyu.com/

你可能感兴趣的文章
Nginx 的配置文件中的 keepalive 介绍
查看>>
Nginx 负载均衡与权重配置解析
查看>>
Nginx 负载均衡详解
查看>>
nginx 配置 单页面应用的解决方案
查看>>
nginx 配置https(一)—— 自签名证书
查看>>
nginx 配置~~~本身就是一个静态资源的服务器
查看>>
Nginx 配置解析:从基础到高级应用指南
查看>>
Nginx下配置codeigniter框架方法
查看>>
nginx添加模块与https支持
查看>>
Nginx用户认证
查看>>
Nginx的Rewrite正则表达式,匹配非某单词
查看>>
Nginx的使用总结(一)
查看>>
Nginx的可视化神器nginx-gui的下载配置和使用
查看>>
Nginx的是什么?干什么用的?
查看>>
Nginx访问控制_登陆权限的控制(http_auth_basic_module)
查看>>
nginx负载均衡器处理session共享的几种方法(转)
查看>>
nginx负载均衡的5种策略(转载)
查看>>
nginx负载均衡的五种算法
查看>>
Nginx运维与实战(二)-Https配置
查看>>
Nginx配置ssl实现https
查看>>