当前位置:网站首页>Data analysis - Matplotlib sample code
Data analysis - Matplotlib sample code
2022-07-02 11:48:00 【yinshuilan】
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(-2, 2, 100)
y1 = np.cos(np.pi * x)
y2 = np.sin(np.pi * x)
plt.plot(x, y1, "go", label=r"$y1=\cos(\pi \times x)$", alpha=0.8, linewidth=0.7)
plt.plot(x, y2, "r-", label=r"$y2=\sin(\pi \times x)$", alpha=0.8, linewidth=0.7)
df = pd.DataFrame(np.random.randint(0, 100, size=(100, 1)), columns=list('A'))
plt.annotate("important Point", (0, 1), xytext=(-1.5, 1.1), arrowprops=dict(arrowstyle='->'))
plt.xlabel("x-axis")
plt.ylabel("y-axis")
# Set the coordinate range [xmin, xmax, ymin, ymax]
plt.axis([-2.1, 2.1, -1.2, 1.2])
# Show labels
plt.legend()
# Show grid
plt.grid(alpha=0.4)
plt.title("Two Plots", color=(0.1, 0.3, 0.5))
plt.show()The operation input is shown in the figure below :

import matplotlib as mpl
mpl.rcParams["font.sans-serif"] = ["Microsoft YaHei"]
mpl.rcParams['axes.unicode_minus'] = Falseabout Ubuntu System , You need to manually specify the font to realize the display of Chinese . The setup code is as follows .

边栏推荐
- 由粒子加速器产生的反中子形成的白洞
- map集合赋值到数据库
- How to Add P-Values onto Horizontal GGPLOTS
- Never forget, there will be echoes | hanging mirror sincerely invites you to participate in the opensca user award research
- ren域名有价值吗?值不值得投资?ren域名的应用范围有哪些?
- On April 17, 2022, the five heart matchmaker team received double good news
- Some things configured from ros1 to ros2
- FLESH-DECT(MedIA 2021)——一个material decomposition的观点
- Develop scalable contracts based on hardhat and openzeppelin (II)
- 【多线程】主线程等待子线程执行完毕在执行并获取执行结果的方式记录(有注解代码无坑)
猜你喜欢

PYQT5+openCV项目实战:微循环仪图片、视频记录和人工对比软件(附源码)
![[visual studio 2019] create MFC desktop program (install MFC development components | create MFC application | edit MFC application window | add click event for button | Modify button text | open appl](/img/6a/111da81436659c7502648907ec1367.jpg)
[visual studio 2019] create MFC desktop program (install MFC development components | create MFC application | edit MFC application window | add click event for button | Modify button text | open appl

Webauthn - official development document
![[idea] use the plug-in to reverse generate code with one click](/img/b0/00375e61af764a77ea0150bf4f6d9d.png)
[idea] use the plug-in to reverse generate code with one click

Map set assignment to database

The computer screen is black for no reason, and the brightness cannot be adjusted.

Cluster Analysis in R Simplified and Enhanced

6方面带你认识LED软膜屏 LED软膜屏尺寸|价格|安装|应用

6. Introduce you to LED soft film screen. LED soft film screen size | price | installation | application

GGPUBR: HOW TO ADD ADJUSTED P-VALUES TO A MULTI-PANEL GGPLOT
随机推荐
Order by injection
How to Add P-Values onto Horizontal GGPLOTS
C file and folder operation
Attribute acquisition method and operation notes of C # multidimensional array
How to Create a Nice Box and Whisker Plot in R
Order by注入
亚马逊云科技 Community Builder 申请窗口开启
ASTParser 解析含有emum 枚举方法的类文件的踩坑记
Is the Ren domain name valuable? Is it worth investing? What is the application scope of Ren domain name?
map集合赋值到数据库
The computer screen is black for no reason, and the brightness cannot be adjusted.
Redis exceeds the maximum memory error oom command not allowed when used memory & gt; ' maxmemory'
ESP32存储配网信息+LED显示配网状态+按键清除配网信息(附源码)
在连接mysql数据库的时候一直报错
HOW TO CREATE AN INTERACTIVE CORRELATION MATRIX HEATMAP IN R
mysql 基本语句
to_bytes与from_bytes简单示例
PLC-Recorder快速监控多个PLC位的技巧
[cloud native] 2.5 kubernetes core practice (Part 2)
Precautions for scalable contract solution based on openzeppelin