mabplotlib——Tex公式

一、概念
(一)mabplotlib自带mathtext引擎,不需安装TeX系统
(二) 作 为 开 始 和 结 束 符 , 如 ‘ 作为开始和结束符,如‘ y=x+z ’ ( 三 ) 特 殊 字 母 的 代 码 需 要 去 官 网 查 二 、 实 例 i m p o r t n u m p y a s n p i m p o r t m a t p l o t l i b . p y p l o t a s p l t f i g = p l t . f i g u r e ( ) a x = f i g . a d d s u b p l o t ( 111 ) a x . s e t x l i m ( [ 1 , 7 ] ) a x . s e t y l i m ( [ 1 , 5 ] ) a x . t e x t ( 2 , 4 , r ′ ’ (三)特殊字母的代码需要去官网查 二、实例 import numpy as np import matplotlib.pyplot as plt fig=plt.figure() ax=fig.add_subplot(111) ax.set_xlim([1,7]) ax.set_ylim([1,5]) ax.text(2,4,r' importnumpyasnpimportmatplotlib.pyplotaspltfig=plt.figure()ax=fig.addsubplot(111)ax.setxlim([1,7])ax.setylim([1,5])ax.text(2,4,r \alpha_i \beta_j \pi \lambda \omega $ ‘,size=25)
ax.text(4,4,r’$ \sin(0)=\cos(\frac{\pi}{2}) $ ‘,size=25)
ax.text(2,2,r’$ \lim_{x \rightarrow y} \frac{1}{x^3} $ ‘,size=25)
ax.text(4,2,r’$ \sqrt[4]{x}=\sqrt[2]{y} $ ',size=25)
plt.show()
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值