# View more python tutorials on my Youtube and Youku channel!!!

# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg
# Youku video tutorial: http://i.youku.com/pythontutorial # 8 - annotation
"""
Please note, this script is for python3+.
If you are using python2+, please modify it accordingly. Tutorial reference:
http://www.scipy-lectures.org/intro/matplotlib/matplotlib.html Mathematical expressions:
http://matplotlib.org/users/mathtext.html#mathtext-tutorial
""" import matplotlib.pyplot as plt
import numpy as np x = np.linspace(-3, 3, 50)
y = 2*x + 1 plt.figure(num=1, figsize=(8, 5),)
plt.plot(x, y,) ax = plt.gca()
ax.spines['right'].set_color('none')
ax.spines['top'].set_color('none')
ax.spines['top'].set_color('none')
ax.xaxis.set_ticks_position('bottom')
ax.spines['bottom'].set_position(('data', 0))
ax.yaxis.set_ticks_position('left')
ax.spines['left'].set_position(('data', 0)) x0 = 1
y0 = 2*x0 + 1
plt.plot([x0, x0,], [0, y0,], 'k--', linewidth=2.5)
plt.scatter([x0, ], [y0, ], s=50, color='b') # method 1:
#####################
plt.annotate(r'$2x+1=%s$' % y0, xy=(x0, y0), xycoords='data', xytext=(+30, -30),
textcoords='offset points', fontsize=16,
arrowprops=dict(arrowstyle='->', connectionstyle="arc3,rad=.2")) # method 2:
########################
plt.text(-3.7, 3, r'$This\ is\ the\ some\ text. \mu\ \sigma_i\ \alpha_t$',
fontdict={'size': 16, 'color': 'r'}) plt.show()

Annotation标注的更多相关文章

  1. spring4笔记----“零配置”:spring提供的几个Annotation标注

    @Component  :标注一个普通的Spring Bean类 @Controller    :标注一个控制器组件器 @Service        :标注一个业务逻辑组件器 @Repository ...

  2. Annotation 标注

    1.画出基本图 当图线中某些特殊地方需要标注时,我们可以使用 annotation. matplotlib 中的 annotation 有两种方法, 一种是用 plt 里面的 annotate,一种是 ...

  3. 一种基于annotation的Spring-mvc权限控制方法

    简介 本文介绍一种采用annotation来对spring-mvc进行权限控制的方法. 通过枚举类来定义权限项. 将annotation标注到需要控制权限的spring-mvc方法上. 然后,在spr ...

  4. 1.2.4 Java Annotation 提要

    (本文是介绍依赖注入容器Spring和分析JUnit源码的准备知识) Java Annotation(标注) java.lang.annotation.Annotation是全部Java标注的父接口. ...

  5. Java Annotation入门

    Java Annotation入门作者:cleverpig 版权声明:本文可以自由转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本声明作者:cleverpig(作者的Blog:http:/ ...

  6. ASP.NET MVC 初体验

    MVC系列文章终于开始了,前段时间公司项目结束后一直在封装一个html+ashx+js+easyui的权限系统,最近差不多也完成了,迟些时候会分享源码给大家.当然这个MVC系列结束后如果时间允许还会另 ...

  7. EF里如何定制实体的验证规则和实现IObjectWithState接口进行验证以及多个实体的同时验证

    之前的Code First系列文章已经演示了如何使用Fluent API和Data Annotation的方式配置实体的属性,比如配置Destination类的Name属性长度不大于50等.本文介绍E ...

  8. [翻译] ORMLite document -- How to Use Part (一)

    前言 此文档翻译于第一次学习 ORMLite 框架,如果发现当中有什么不对的地方,请指正.若翻译与原文档出现任何的不相符,请以原文档为准.原则上建议学习原英文文档. ----------------- ...

  9. Hibernate的映射组件属性

    组件属性 如果持久化类的属性并不是基本数据类型,也不是一个日期或者字符串常量,而是一个复合类型的对象,例如 private Name name; 那么这就是一个组件属性. 组件属性可以是任何普通的ja ...

随机推荐

  1. cassandra 系统分析 架构

    cassandra cassandra是无中心节点的列式数据库 集群管理:      使用gossip算法,最终每个节点都知道集群中的所有节点信息,新增一个节点,新节点发送上线消息,     其他节点 ...

  2. springboot打包,jar包可以以service方式启动

    <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> ...

  3. Linux中的各种文件类型

    Linux中有一句话:一切皆是文件 1.普通文件( -       regular file ) (1).文本文件 文件中的内容是由文本构成的,文本指的是ASCII码字符.文件里的内容本质上都是数字( ...

  4. top 命令中的VIRT,RES,SHR ,MEM区别

    VIRT 表示进程的虚拟(地址)空间大小,其包含进程实际使用的大小(申请的堆栈), 使用mmap映射的大小,包括外设RAM, 还有映射到本进程的文件(例如动态库),还有进程间的共享内存.所以VIRT ...

  5. Codeforces 1292A/1293C - NEKO's Maze Game

    题目大意: 有一个2*n的图 NEKO#ΦωΦ要带领mimi们从(1,1)的点走到(2,n)的点 每次会操作一个点,从可以通过到不可以通过,不可以通过到可以通过 每操作一次要回答一次NEKO#ΦωΦ能 ...

  6. [tire+最短路]Bless You Autocorrect!

    [tire+最短路]Bless You Autocorrect! Typing on phones can be tedious. It is easy to make typing mistakes ...

  7. Solving ordinary differential equations I(Nonstiff Problems),Exercise 1.2:A wrong solution

    (Newton 1671, “Problema II, Solutio particulare”). Solve the total differential equation $$3x^2-2ax+ ...

  8. centos 7 安装及配置vsftpd

    一.防火墙开放21端口 二.创建FTP用户,创建完用户后在/etc/passwd里是这样呈现的:ftpuser:x:1008:1008::/var/www/html:/sbin/nologin 三.y ...

  9. Zabbix 监控sqlserver

    转:Zabbix 监控sqlserver 一:Zabbix监控sqlserver 方法一: 1.思路整理 1.在zabbix server上安装Freetds.unixODBC.unixODBC-de ...

  10. 98)PHP,文件类型获取和创建文件夹

    看手册  finfo这个类:This class provides an object oriented interface into the fileinfo functions. 这个$mime_ ...