博客
关于我
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/

你可能感兴趣的文章
N皇后问题
查看>>
N皇后问题
查看>>
n种方式教你用python读写excel等数据文件
查看>>
OAuth 2.0 MAC Tokens
查看>>
OAuth 及 移动端鉴权调研
查看>>
OAuth2 + Gateway统一认证一步步实现(公司项目能直接使用),密码模式&授权码模式
查看>>
OAuth2 Provider 项目常见问题解决方案
查看>>
OAuth2 vs JWT,到底怎么选?
查看>>
Vue.js 学习总结(14)—— Vue3 为什么推荐使用 ref 而不是 reactive
查看>>
oauth2-shiro 添加 redis 实现版本
查看>>
OAuth2.0_JWT令牌-生成令牌和校验令牌_Spring Security OAuth2.0认证授权---springcloud工作笔记148
查看>>
OAuth2.0_JWT令牌介绍_Spring Security OAuth2.0认证授权---springcloud工作笔记147
查看>>
OAuth2.0_介绍_Spring Security OAuth2.0认证授权---springcloud工作笔记137
查看>>
OAuth2.0_完善环境配置_把资源微服务客户端信息_授权码存入到数据库_Spring Security OAuth2.0认证授权---springcloud工作笔记149
查看>>
OAuth2.0_授权服务配置_Spring Security OAuth2.0认证授权---springcloud工作笔记140
查看>>