首页 > 其他分享 >2.5

2.5

时间:2024-10-28 12:42:15浏览次数:4  
标签:plt figure rcParams np import pi 2.5

代码

点击查看代码
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'
u = np.linspace(0,2*np.pi,50)
v = np.linspace(-np.pi/2,np.pi/2,50)
u, v = np.meshgrid(u, v)
x = 2*np.cosh(v)*np.cos(u)
y = np.sqrt(10)*np.cosh(v)*np.sin(u)
z = 2*np.sqrt(2)*np.sinh(v)

fig = plt.figure(dpi=300)
ax = fig.add_subplot(projection='3d')
ax.plot_surface(x, y, z, cmap='ocean')
plt.show()

标签:plt,figure,rcParams,np,import,pi,2.5
From: https://www.cnblogs.com/fzn666/p/18510234

相关文章

  • 2.5(学号:3025)
    importnumpyasnpimportmatplotlib.pyplotaspltfrommpl_toolkits.mplot3dimportAxes3D定义参数u和vu=np.linspace(-2,2,400)v=np.linspace(0,2*np.pi,400)U,V=np.meshgrid(u,v)根据参数方程计算x,y,zx=np.sqrt(1+U2+V2)*np.cos(V)y=np......
  • transformers 推理 Qwen2.5 等大模型技术细节详解(二)AutoModel 初始化和模型加载(免费
    接上文:transformers推理Qwen2.5等大模型技术细节详解(一)transformers包和对象加载老牛同学和大家通过Transformers框架的一行最常见代码fromtransformersimportAutoModelForCausalLM,走读了transformers包初始化代码的整个流程。从中体会到了dummy对象、LazyModule延迟......
  • sicp每日一题[2.58]
    Exercise2.58Supposewewanttomodifythedifferentiationprogramsothatitworkswithordinarymathematicalnotation,inwhich+and*areinfixratherthanprefixoperators.Sincethedifferentiationprogramisdefinedintermsofabstractdata,we......
  • Day 12.5 复习
    目录1数据类型内置方法1.1整形类型内置方法1.2浮点型类型内置方法1.3字符串类型内置方法1.3.1优先掌握1.3.2需要掌握1.3.3了解1.4列表类型内置方法1.4.1优先掌握1.4.2需要掌握1.5元组类型内置方法优先掌握1.6字典类型内置方法1.6.1优先掌握1.6.2需要掌握1.7集合类......
  • 双通道16bit 10G 采样,带宽2.5 GHz
    今天,Spectrum很高兴地宣布,我们的下一代超快AWG卡的发布。M5i.63xx系列来了!TodaySpectrumInstrumentationispleasedtoannouncethereleaseofournextgenerationofultrafastAWGcards.TheM5i.63xxseriesishere!双通道和单通道型号现已推出四款新板卡,输出速率......
  • 开源模型应用落地-Qwen2.5-7B-Instruct与vllm实现离线推理-CPU版本
    一、前言   离线推理能够在模型训练完成后,特别是在处理大规模数据时,利用预先准备好的输入数据进行批量推理,从而显著提高计算效率和响应速度。通过离线推理,可以在不依赖实时计算的情况下,快速生成预测结果,从而优化决策流程和提升用户体验。此外,离线推理还可以降低云计算成本......
  • sicp每日一题[2.56]
    Exercise2.56Showhowtoextendthebasicdifferentiatortohandlemorekindsofexpressions.Forinstance,implementthedifferentiationruled(x^n)/dx=nx^(n-1)byaddinganewclausetothederivprogramanddefiningappropriateproceduresexpone......
  • 习题2.5
    习题2.5代码importnumpyasnpimportpandasaspdimportsympyasspsp.init_printing(use_unicode=True)importmatplotlib.pyplotaspltplt.rcParams['font.sans-serif']=['TimesNewRoman+SimSun+WFMSansSC']plt.rcParams['mathtext......
  • sicp每日一题[2.52]
    Exercise2.52MakechangestothesquarelimitofwaveshowninFigure2.9byworkingateachofthelevelsdescribedabove.Inparticular:a.AddsomesegmentstotheprimitivewavepainterofExercise2.49(toaddasmile,forexample).b.Changethe......
  • 2.5
    importnumpyasnpimportmatplotlib.pyplotasplta=2b=np.sqrt(10)c=np.sqrt(8)phi=np.arange(0,2*np.pi+0.1,0.1)theta=np.arange(-1,1.1,0.1)[:,np.newaxis]x=a*np.cosh(theta)*np.cos(phi)y=b*np.cosh(theta)*np.sin(phi)z=c*n......