matplot 代码实例

#!/usr/bin/env python
# coding=utf-8 import numpy as np
import matplotlib.pyplot as plt ax = plt.subplot(111)
t = np.arange(0,5,0.01)
s = np.cos(2*np.pi*t)
line = plt.plot(t,s,lw=5)
plt.annotate('local max',xy=(2,1),xytext=(3,1.5),arrowprops=dict(facecolor='green',shrink=0.1))
plt.ylim(-2,2)
#plt.show() ##########
fig = plt.figure()
fig.suptitle(' bold main title ',fontsize=15,fontweight='bold')
ax = fig.add_subplot(111)
fig.subplots_adjust(top=0.8)
ax.set_title("axes title")
ax.set_xlabel("xlabel")
ax.set_ylabel("ylabel")
ax.text(3,8,"boxed italics text in data coords",style='italic',bbox={'facecolor':'red','alpha':0.5,'pad':10})
ax.text(2,6,r'an eauation: $E=mc^2$',fontsize=20)
ax.text(0.95,0.01,'colored text in axes coords',verticalalignment='bottom',horizontalalignment='right',transform=ax.transAxes, color='green',fontsize=15)
ax.plot([2],[1],'o') ax.annotate('annotate',xy=(2,1),xytext=(3,4),arrowprops = dict(facecolor='blue',shrink=0.1))
ax.axis([0,10,0,12])
plt.show()

matplot 代码实例的更多相关文章

  1. matplot 代码实例2

    要画出如上图(注意原点有边距),怎么办呢? 简单而优雅,请看代码: #!/usr/bin/env python # coding=utf-8 import matplotlib.pyplot as p ...

  2. MATLAB的PLOT函数线型设置及横坐标为字符串的代码实例

    2.横坐标为字符串的代码实例 cell={‘PLS’,’SVM’,’RF’,’NNET’,’NB’,’PLR’,’C5.0′,’PDA’,’KNN’,’GLM’,’BCT’};%分类方法yData=[ ...

  3. web service上传参数代码实例

    web service上传参数代码实例 这次做的项目用到webservice比较多,最开始在网上看的参考dome,发现都不行,后来发现安卓4.0以后有很大的不同,在做传参时,有些东西需要注意: 第一, ...

  4. (转)combogrid的代码实例

    EasyUI中combogrid的代码实例 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" &q ...

  5. PHP生成迅雷、快车、旋风等软件的下载链接代码实例

    PHP生成迅雷.快车.旋风等软件的下载链接代码实例 <?php function Download() { $urlodd=explode('//',$_POST["url" ...

  6. Scala 深入浅出实战经典 第45讲: scala中context bounds代码实例

    王家林亲授<DT大数据梦工厂>大数据实战视频 Scala 深入浅出实战经典(1-64讲)完整视频.PPT.代码下载:百度云盘:http://pan.baidu.com/s/1c0noOt6 ...

  7. 关于JAVA中事件分发和监听机制实现的代码实例-绝对原创实用

    http://blog.csdn.net/5iasp/article/details/37054171 文章标题:关于JAVA中事件分发和监听机制实现的代码实例 文章地址: http://blog.c ...

  8. input文本框实现宽度自适应代码实例

    代码实例如下: <!DOCTYPE html> <html><head><meta charset="utf-8"><meta ...

  9. jQuery实现的鼠标滑过切换图片代码实例

    jQuery实现的鼠标滑过切换图片代码实例:有时候网页需要这样的简单效果,那就是当鼠标滑过默认图片的时候,能够实现图片的切换,可能在实际应用中,往往没有这么简单,不过大家可以自行扩展一下,下面简单介绍 ...

随机推荐

  1. Linux->卸载Mysql方法总结

    如何在Linux下卸载MySQL数据库呢? 下面总结.整理了一下Linux平台下卸载MySQL的方法. MySQL的安装主要有三种方式:二进制包安装(Using Generic Binaries).R ...

  2. cocos2dx 不同平台上加载文件

    原文转自:http://blog.sina.com.cn/s/blog_62b2318d0101eozt.html cocos2dx在不同平台上读取资源文件时的处理方式是不同的. 在ios下,程序调用 ...

  3. TypeError: HashUpdate fail

    关于crypto的md5加密报错: 代码: var crypto = require('crypto'); var md5 = crypto.createHash('md5'); //crypto模块 ...

  4. arcgis-tomcat-cors

    C:\Program Files\ArcGIS\Server\framework\runtime\tomcat\webapps\arcgis#rest\WEB-INF\ (1)添加cors-filte ...

  5. 批量读取文件matlab

    前言 工程实现的过程中经常需要依次读取文件夹中的图像(或者其他文件),本文就对此进行实现. 代码 % /************************************************ ...

  6. Unity 3D的常用快捷键

    Unity中的常用快捷键 本文提供全流程,中文翻译.Chinar坚持将简单的生活方式,带给世人!(拥有更好的阅读体验 -- 高分辨率用户请根据需求调整网页缩放比例) 1 Windows系统Unity3 ...

  7. 网络流--最小费用最大流MCMF模板

    标准大白书式模板 #include<stdio.h> //大概这么多头文件昂 #include<string.h> #include<vector> #includ ...

  8. excel导出: mac safari对application/x-msdownload的支持不佳

    https://blog.csdn.net/lizeyang/article/details/8982155?locationNum=3&fps=1 http://tool.oschina.n ...

  9. LeetCode Factorial Trailing Zeroes Python

    Factorial Trailing Zeroes Given an integer n, return the number of trailing zeroes in n!. 题目意思: n求阶乘 ...

  10. Java Web HelloWorld!

    距离上次做Java Web开发已经两年多了,我几乎忘得一干二净……都忘记咋搭建环境了……,然后Eclipse官网莫名其妙的挂掉.幸好电脑里还有份两年前的开发环境备份…… 重拾Java Web开发啊,说 ...