import matplotlib.pyplot as plt
import numpy as np def demo_test():
a=np.array([0.15,0.16,0.14,0.17,0.12,0.16,0.1,0.08,0.05,0.07,0.06]);
max_indx=np.argmax(a)#max value index
min_indx=np.argmin(a)#min value index
plt.plot(a,'r-o')
plt.plot(max_indx,a[max_indx],'ks')
show_max='['+str(max_indx)+' '+str(a[max_indx])+']'
plt.annotate(show_max,xytext=(max_indx,a[max_indx]),xy=(max_indx,a[max_indx]))
plt.plot(min_indx,a[min_indx],'gs')
plt.show() if __name__=="__main__":
demo_test();

关键是找出坐标.

matplotlib-------标记特殊点的更多相关文章

  1. Matplotlib学习笔记(一)

    原   matplotlib学习笔记 参考:Python数据科学入门教程 Python3.6.1 jupyter notebook .caret, .dropup > .btn > .ca ...

  2. matplotlib初识

    Matplotlib 能够创建多数类型的图表,如条形图,散点图,条形图,饼图,堆叠图,3D 图和地图图表. import matplotlib.pyplot as plt plt.plot([,,], ...

  3. Matplotlib学习---matplotlib里颜色,标记,线条类型参数的选择(colors, markers, line styles)

    颜色(Colors): 基础颜色: character color 'b' blue 'g' green 'r' red 'c' cyan 'm' magenta 'y' yellow 'k' bla ...

  4. matplotlib ----- 颜色, 标记样式

    颜色: 蓝色 - 'b' 绿色 - 'g' 红色 - 'r' 青色 - 'c' 品红 - 'm' 黄色 - 'y' 黑色 - 'k' 白色 - 'w' 线: 直线 - '-' 虚线 - '--' 点线 ...

  5. matplotlib 学习笔记02:marker标记详解

    本文内容来自于matplotlib官网:matplotlib官网markers资料 This module contains functions to handle markers. Used by ...

  6. matplotlib设置颜色、标记、线条,让你的图像更加丰富

    今天是数据处理专题的第11篇文章,我们继续来介绍matplotlib这个包的使用方法. 在上一篇文章当中我们介绍了matplotlib当中subplot的概念以及用法,今天我们将会来介绍matplot ...

  7. matplotlib 安装与使用

    1.在ubuntu下输入 sudo apt-get install python-matplotlib 安装matplotlib 2.简单代码使用

  8. 【Matplotlib】绘图常见设置说明

    说明:此贴会不定期进行更新! 设置1:图像的大小设置. 如果已经存在figure对象,可以通过以下代码设置尺寸大小: f.set_figheight(15) f.set_figwidth(15) 若果 ...

  9. matplotlib库的常用知识

    看看matplotlib是什么? matplotlib是python上的一个2D绘图库,它可以在夸平台上边出很多高质量的图像.综旨就是让简单的事变得更简单,让复杂的事变得可能.我们可以用matplot ...

  10. python学习(三):matplotlib学习

    前言:matplotlib是一个python的第三方库,里面的pyplot可以用来作图.下面来学习一下如何使用它的资源. 一.使用前 首先在python中使用任何第三方库时,都必须先将其引入.即: i ...

随机推荐

  1. Freemarker 简介

    1.动态网页和静态网页差异 在进入主题之前我先介绍一下什么是动态网页,动态网页是指跟静态网页相对应的一种网页编程技术.静态网页,随着HTML代码的生成,页面的内容和显示效果就不会再发生变化(除非你修改 ...

  2. temp table

    在Oracle8i或以上版本中,可以创建以下两种临时表: 1.会话特有的临时表 CREATE GLOBAL TEMPORARY <TABLE_NAME> ( <column spec ...

  3. 绑定任意格式的XML文档到WPF的TreeView

    Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> ...

  4. Windows 平台安装 MongoDB

    官方文档:https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/ 系统环境:win7 MongoDb:mongodb- ...

  5. 谈谈http与https

    今天简单的来说一下http和https, 简单来讲: HTTP 是 超文本协议,TCP 端口是 80    HTTPS 是一种配合了SSL协议的.加密的HTTP 协议 ,TCP端口是 443 HTTP ...

  6. Android开发中需要注意哪些坑

    作为一个有两.三年Android应用开发经验的码农,自然会遇到很多坑,下面是我能够想起的一些坑(实践证明不记笔记可不是个好习惯),后面有想到其它坑会陆续补上. 1.在Android library中不 ...

  7. hdu-4023-博弈(模拟)

    Game Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65768/65768 K (Java/Others)Total Submis ...

  8. 页面跳转 Server.Transfer和 Response.Redirect的区别

    1.Server.Transfer 用于把处理的控制权从一个页面转移到另一个页面,在转移的工程中没有离开服务器内部控件(如request,session等)保存的信息不变.因此你能从a页面跳转到b页面 ...

  9. linux thtree level page tables

    To translate a virtual address into a physical one, the CPU must take the contents of each level fie ...

  10. 快速切题 cf118A

    这教导人们一定要看题,要看题,元音包含了‘y’,完毕,要看题啊 #include <cstring> #include <cstdio> #include <cctype ...