首页 > 其他分享 >2.4

2.4

时间:2024-10-28 12:43:52浏览次数:2  
标签:plt 3513958 unicode rcParams import font 2.4

  • 代码
点击查看代码
import numpy as np
import pandas as pd
import sympy as sp
sp.init_printing(use_unicode=True)
import matplotlib.pyplot as plt
plt.rcParams['font.sans-serif']=['Times New Roman + SimSun + WFM Sans SC']
plt.rcParams['mathtext.fontset']='cm'
# Times New Roman + SimSun + WFM Sans SC
# simsum宋体, times new roman -*, simhei黑体, kaiti楷体,
# dengxian等线, fangsong仿宋, Microsoft Yahei微软雅黑
plt.rcParams['axes.unicode_minus']=False
plt.rcParams['figure.dpi'] = 200
# plt.rcParams['figure.figsize'] = [4, 3]
# plt.rcParams['font.size'] = 12
plt.rcParams['xtick.direction'] = 'in'
plt.rcParams['ytick.direction'] = 'in'
s=['*r-','ob-','sy-','pc-','Hg-','>k-']
x = np.linspace(-5, 5, 50)
fx = lambda x, k: k*x**2 + 2*k
for i in range(1, 7):
    plt.subplot(2, 3, i)
    # plt.title(f'$y={i}x^2+2{i}$')
    plt.xlabel('x')
    plt.ylabel('y')
    plt.plot(x, fx(x, i), s[i-1], label=f'k={i}')
    plt.legend()
    plt.show()


* 运行结果 ![](/i/l/?n=24&i=blog/3513958/202410/3513958-20241028124454055-1859983429.png)

标签:plt,3513958,unicode,rcParams,import,font,2.4
From: https://www.cnblogs.com/fzn666/p/18510232

相关文章

  • 2.4(学号:3025)
    importnumpyasnpimportmatplotlib.pyplotasplt定义x的范围x=np.linspace(-10,10,400)创建一个2行3列的子图布局fig,axs=plt.subplots(2,3,figsize=(12,8))遍历每个子图fork,axinenumerate(axs.flat,start=1):y=k*x**2+2*kax.plot(x,y,label......
  • 2.4GHz和5GHz Wi-Fi哪个更适合家庭使用
    选择家庭Wi-Fi时,频段选择是关键因素。为能够帮助用户作出明智决策,本文将从多个方面来比较2.4GHz和5GHz频段,包括:1.信号覆盖范围;2.数据传输速率;3.干扰情况;4.设备兼容性;5.应用场景。相比之下,2.4GHz频段信号穿透力强,覆盖范围广,但容易受到干扰,适合低速率的互联网使用。5GHz频段提供更......
  • 例题2.40
    例题2.40代码importpandasaspdimportnumpyasnp创建一个DataFrame,其中包含10行4列的随机整数(1到5之间),并添加一个名为'A'的随机列np.random.seed(0)#设置随机种子以确保结果可复现d=pd.DataFrame(np.random.randint(1,6,(10,3)),columns=list("BCD"))......
  • 例题2.41
    例题2.41代码importpandasaspdimportnumpyasnpa=pd.DataFrame(np.random.randint(1,6,(5,3)),index=['a','b','c','d','e'],columns=['one','two','three'])a.loc['a&......
  • 习题2.4
    习题2.4代码importnumpyasnpimportpandasaspdimportsympyasspsp.init_printing(use_unicode=True)importmatplotlib.pyplotaspltplt.rcParams['font.sans-serif']=['TimesNewRoman+SimSun+WFMSansSC']plt.rcParams['mathtext......
  • AT2401C 功率放大器(PA)2.4g集成芯片 完全取代替代RFX2401C兼容软件硬件
    AT2401C功率放大器(PA)2.4g集成芯片完全取代替代RFX2401C兼容软件硬件AT2401C功率放大器(PA)射频前端集成芯片,它是一款面向Zigbee,无线传感网络以及其他2.4GHz频段无线系统的全集成射频功能的射频前端单芯片。AT2401C内部集成了功率放大器(PA),低噪声放大器(LNA),芯片收发开关控制......
  • sicp每日一题[2.49]
    Exercise2.49Usesegments->paintertodefinethefollowingprimitivepainters:a.Thepainterthatdrawstheoutlineofthedesignatedframe.b.Thepainterthatdrawsan“X”byconnectingoppositecornersoftheframe.c.Thepainterthatdrawsad......
  • sicp每日一题[2.48]
    Exercise2.48Adirectedlinesegmentintheplanecanberepresentedasapairofvectors—thevectorrunningfromtheorigintothestart-pointofthesegment,andthevectorrunningfromtheorigintotheend-pointofthesegment.Useyourvectorrepre......
  • Bilidown v1.2.4 B站在线视频下载解析工具中文单文件版
    Bilidown是一款专为B站视频下载而设计的工具,一款简洁好用的B站视频下载工具,支持由UP主上传的单集,多集以及相关封面,弹幕,字幕,音乐,刮削等等,支持任意粒度批量组合,登录后最高支持到1080P,大会员可获取所有画质及音质。Bilidown具有强大的功能和简便的操作界面。Bilidown可以下载B站上......
  • sicp每日一题[2.47]
    Exercise2.47Herearetwopossibleconstructorsforframes:(define(make-frameoriginedge1edge2)(listoriginedge1edge2))(define(make-frameoriginedge1edge2)(consorigin(consedge1edge2)))Foreachconstructorsupplytheappropriate......