python笔记:5.1.2.1matplotlib_图形基本设置_刻度设置

# -*- coding: utf-8 -*-
"""
Created on Fri Jun  7 16:49:34 2019

@author: User
"""


import numpy as np
import pandas as pd
import matplotlib as mpl
import matplotlib.pyplot as plt

X=np.linspace(-np.pi,np.pi,256,endpoint=True)
C,S=np.cos(X),np.sin(X)
plt.plot(X,C,'--')
plt.plot(X,S)
plt.xticks([-np.pi, -np.pi/2, 0, np.pi/2, np.pi],
           [r'$-\pi$',r'$-\pi/2$',r'$0$',r'$+\pi/2$',r'$+\pi$'])
plt.yticks([-1,0,+1],[r'$-1$',r'$0$',r'$+1$'])
plt.show()

运行:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
当出现"ModuleNotFoundError: No module named 'matplotlib_inline'"错误时,通常是因为环境中缺少matplotlib_inline模块。要解决这个问题,你可以按照以下步骤进行操作: 1. 确保你已经正确安装了matplotlib模块。你可以使用以下命令来安装matplotlib: - 对于Python 2:`pip install matplotlib` - 对于Python 3:`pip3 install matplotlib` 2. 如果你已经安装了matplotlib模块,但仍然出现错误,那么可能是因为你需要安装matplotlib_inline模块。你可以使用以下命令来安装matplotlib_inline模块: - 对于Python 2:`pip install matplotlib-inline` - 对于Python 3:`pip3 install matplotlib-inline` 3. 安装完成后,重新运行你的代码,应该就可以正常使用matplotlib_inline模块了。 请注意,如果你在使用虚拟环境,请确保你在虚拟环境中安装和执行matplotlibmatplotlib_inline模块。另外,如果你在使用不同的Python版本,确保你安装了对应版本的模块。 希望这些信息对你有帮助!<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [如何解决错误 ModuleNotFoundError:No module named“matplotlib](https://blog.csdn.net/wyxtx/article/details/128406382)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值