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. Confluence 6 配置 LDAP 连接池

    当 LDAP 连接池被启用后,LDAP 目录服务器将会维护一个连接池同时当必要的时候指派他们.当一个连接关闭后,这个连接将会放回到连接池中供以后进行使用.这种设置将会有效的提高系统性能. 希望配置 L ...

  2. 当保存在Session中的对象,取出后,在外部发生改变时会怎样

    return_reason_model model = new return_reason_model(); model.F_RetunrnReason = "; HttpContext.S ...

  3. Kilani and the Game CodeForces - 1105D (bfs)

    沙茶bfs打了2小时... queue入队量太大了, 放函数里直接T了, 改成全局46ms #include <iostream> #include <algorithm> # ...

  4. ssh The authenticity of host '10.11.26.2 (10.11.26.2)' can't be established

    The authenticity of host '10.11.26.2 (10.11.26.2)' can't be established. ECDSA key fingerprint is SH ...

  5. hdu-3276-dp+二分+单调队列

    Star Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submis ...

  6. Unity3D中的函数方法和解释

    一.刷新函数 Update 当MonoBehaviour启用时,其Update在每一帧被调用. LateUpdate 当Behaviour启用时,其LateUpdate在每一帧被调用. FixedUp ...

  7. redis 处理命令的过程

    redis版本:redis-3.2.9 在客户端输入 set name zhang,调试redis服务器,得到调用栈如下: 在dictReplace中加了断点,结果跳出来4个线程,redis还是单进程 ...

  8. C#winform窗体如何通过windowApi的FindWindow函数获取窗体句柄

    在同一个程序里,传统方式是通过this来设置当前窗体的最大化.最小化等操作, 那么怎样通过窗体句柄来设置窗体的最大化.最小化呢? 1.界面布局 通过this设置窗体最大化: name:btnWindo ...

  9. POJ 1166 暴力搜索 即 枚举

    e.... 米还是没有读懂题....T_T ..... e.... 这就是传说中的暴力吗....太血腥了....太暴力了...九重for循环....就这么赤裸裸的AC了.... 水是水了点..但是.. ...

  10. Flask初级(十)flash与前台交互post详解

    Project name :Flask_Plan templates:templates static:static POST提交方式,首先要有表单 老实去改模板文件吧. 查询窗口我准备放在页面最顶上 ...