日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

【数学建模之Python】11.炉温曲线可视化

發布時間:2024/1/1 python 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【数学建模之Python】11.炉温曲线可视化 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

如果解決了你的問題,點個贊再走嘛?(?????)?

目前正在做高教杯2020年A題,記錄一下可視化過程,不斷更新

?根據制程界限繪圖

1.已知某次實驗數據(附件中),根據本次實驗數據做可視化

import numpy as np import pandas as pd import matplotlib.pyplot as plt import warningswarnings.filterwarnings('ignore') # 忽略警告plt.rc('font', size=16) plt.rc('font', family='SimHei') plt.rc('axes', unicode_minus=False)a = pd.read_excel('附件.xlsx')T = a.values # 爐溫數據 T_up217 = T[np.where(T[:, 1] > 217)[0]] # 大于217攝氏度的數組 T_up217_time = T_up217[-1, 0] - T_up217[0, 0] # 大于217攝氏度的時間 T_max = T[np.where(T[:, 1] == np.max(T[:, 1]))[0], :] # 峰值溫度及對應時間 T_between150and190 = T[np.where((T[:, 1] > 150) * (T[:, 1] < 190) * (T[:, 0] < T_max[0, 0]))[0]] # 上升過程中150攝氏度至190攝氏度plt.figure('某次實驗爐溫曲線') plt.plot(T[:, 0], T[:, 1], linestyle='--', linewidth=5, color='dodgerblue', alpha=0.5,label='完整數據') # alpha=1時完全不透明,alpha=0時完全透明 plt.plot(T_max[:, 0], T_max[:, 1], linewidth=5, color='black', label='峰值') plt.plot(T_up217[:, 0], T_up217[:, 1], linestyle='-', linewidth=2, color='red', label='大于217攝氏度') plt.plot(T_between150and190[:, 0], T_between150and190[:, 1], linestyle='-', linewidth=2, color='orange',label='上升過程中150攝氏度至190攝氏度') plt.xticks(np.arange(0, 450, 50)) plt.legend() # 顯示圖例 plt.xlabel('時間/t') plt.ylabel('溫度/℃')plt.annotate(s="(%s,%s)和(%s,%s)" % (T_max[0, 0], T_max[0, 1], T_max[1, 0], T_max[1, 1]),xy=(T_max[0, 0], T_max[0, 1]),xytext=(40, 50),textcoords='offset points',arrowprops=dict(headlength=5, width=1, color='black')) # 標注峰值# 大于217攝氏度的標注 plt.annotate(s="(%s,%s)" % (T_up217[0, 0], T_up217[0, 1]),xy=(T_up217[0, 0], T_up217[0, 1]),xytext=(10, -40),textcoords='offset points',arrowprops=dict(headlength=5, width=1, color='red')) # 標注左臨界值 plt.annotate(s="(%s,%s)" % (T_up217[-1, 0], T_up217[-1, 1]),xy=(T_up217[-1, 0], T_up217[-1, 1]),xytext=(50, 0),textcoords='offset points',arrowprops=dict(headlength=5, width=1, color='red')) # 標注右臨界值# 上升過程中150~190攝氏度的標注 plt.annotate(s="(%s,%s)" % (T_between150and190[0, 0], T_between150and190[0, 1]),xy=(T_between150and190[0, 0], T_between150and190[0, 1]),xytext=(10, -40),textcoords='offset points',arrowprops=dict(headlength=5, width=1, color='orange')) # 標注左臨界值 plt.annotate(s="(%s,%s)" % (T_between150and190[-1, 0], T_between150and190[-1, 1]),xy=(T_between150and190[-1, 0], T_between150and190[-1, 1]),xytext=(10, -40),textcoords='offset points',arrowprops=dict(headlength=5, width=1, color='orange')) # 標注右臨界值plt.show()

效果圖:?

總結

以上是生活随笔為你收集整理的【数学建模之Python】11.炉温曲线可视化的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。