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. Excel根据人名匹配得到编号

    操作步骤:输入公式 =IF(COUNTIF($E$2:$E2,$E2)>COUNTIF($B:$B,$E2),"",INDEX(C:C,SMALL(IF($B$1:$B$10 ...

  2. <youcengcibianli>

    #include<stdio.h> #include<stdlib.h> #include<string.h> #define num 100 #define OK ...

  3. java程序员常用的八个工具

    以下这8个工具,从代码构建到错误挤压,覆盖Java开发的全域.学习这些工具可以帮助你改善代码质量,成为一个更高效的Java开发人员. 1.Eclipse 尽管IntelliJ IDEA.NetBean ...

  4. ABP .Net Core To Json序列化配置

     一. 前言 我们采用ABP架构用MVC Controller或Web API返回给前端结果ToJson序列化后得到的属性命名都是采用js的驼峰格式,即首字母小写,后面单词首字母大写的格式(如:后台属 ...

  5. 【Android 】查看被测应用程序package和launchable-activity

    [appt] appt 工具所在位置..\sdk\build-tools\23.0.1\aapt.exe #查看Package>aapt dump badging C:\QQemail.apk ...

  6. SWIFT中计算两个日期间隔多少小时

    SWIFT中如何计算两个日期间隔多少个小时,其实几句代码就可以搞定了,Very Easy,在Playground内输入以下代码 var date1 = "2015-06-26 8:15:10 ...

  7. 1.1.4 A+B for Input-Output Practice (V)

    A+B for Input-Output Practice (V) Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K ...

  8. qt5 交叉编译

    qtbase/mkspecs/linux-arm-gnueabi-g++/qmake.conf 添加 QMAKE_LFLAGS += -Wl,-rpath-link,$$[QT_SYSROOT]/us ...

  9. 截图保存 matlab

    file=dir('D:\Program Files\MATLAB\R2014a\bin\MyPro\OCR\图像中时间识别\')for i=3:length(file) path= strcat(' ...

  10. .NET 中什么样的类是可使用 await 异步等待的?

    我们已经知道 Task 是可等待的,但是去看看 Task 类的实现,几乎找不到哪个基类.接口或者方法属性能够告诉我们与 await 相关. 而本文将探索什么样的类是可使用 await 异步等待的? D ...