新增鲜出炉的 Python 和 Turtle 支持
import math
import turtle as tl
radius = 120
tl.color('red', 'yellow')
# 让图画位于中心
tl.up()
tl.backward(radius)
tl.down()
tl.begin_fill()
while True:
tl.forward(radius * 2)
tl.left(170)
# 回到起点
if math.sqrt((tl.pos()[0] + radius) ** 2 + tl.pos()[1] ** 2) < 1:
break
tl.end_fill()
tl.done()
%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np
# plt.rcParams['font.sans-serif'] = ['SimHei'] # 替換sans-serif字型
plt.rcParams['axes.unicode_minus'] = False
plt.style.use('fivethirtyeight')
x = np.linspace(0, 10, 1000)
y = np.sin(x)
z = np.cos(x ** 2)
plt.figure(figsize=(8, 4))
plt.plot(x, y, label="$sin(x)$", color="red", linewidth=2)
plt.plot(x, z, "b--", label="$cos(x^2)$")
plt.xlabel("x轴")
plt.ylabel("y轴")
plt.title("标题")
plt.ylim(-1.2, 1.2)
plt.legend()
plt.show()
import pandas as pd
dataframe = pd.read_csv('~/common_data/历史水资源情况.csv')
print(dataframe)
附件资料
没有附件
所需硬件
暂无数据
问天鼓
美科科技问天鼓
作品信息
Connie
👍
回复0
立即注册