• Python Pandas数据处理作图——霍尔效应


    1. import pandas as pd
    2. import matplotlib.pyplot as plt
    3. data = {'UH': [19.92, 39.73,59.63, 79.64, 99.01, 118.43, 138.10, 157.91,177.61],
    4. 'Is': [0.50, 1.00, 1.50, 2.00, 2.50, 3.00, 3.50,4.00,4.50]}
    5. df = pd.DataFrame(data)
    6. df.set_index('UH', inplace=True)
    7. df.plot(kind='line', y='Is', marker='o')
    8. plt.title('UH-Is IM=600mA')
    9. plt.xlabel('UH (mV)')
    10. plt.ylabel('Is (mA)')
    11. df_reset = df.reset_index()
    12. for i, txt in enumerate(df_reset['Is']):
    13. plt.annotate(f'{ df_reset["Is"][i],df_reset["UH"][i]}', (df_reset['UH'][i], df_reset['Is'][i]), ha='center', va='bottom')
    14. plt.show()

     

    1. import pandas as pd
    2. import matplotlib.pyplot as plt
    3. data = {'UH': [2.62, 13.24,23.79, 34.37, 44.98, 55.56, 66.02],
    4. 'IM': [0.04, 0.20, 0.36, 0.52, 0.68, 0.84, 1.00]}
    5. df = pd.DataFrame(data)
    6. df.set_index('UH', inplace=True)
    7. df.plot(kind='line', y='IM', marker='o')
    8. plt.title('UH-IM Is=1.00mA')
    9. plt.xlabel('UH (mV)')
    10. plt.ylabel('IM (mA)')
    11. df_reset = df.reset_index()
    12. for i, txt in enumerate(df_reset['IM']):
    13. plt.annotate(f'{ df_reset["IM"][i],df_reset["UH"][i]}', (df_reset['UH'][i], df_reset['IM'][i]), ha='center', va='bottom')
    14. plt.show()

     

     

    1. import pandas as pd
    2. import matplotlib.pyplot as plt
    3. data = {'UH': [9.54, 18.73, 27.97, 37.16, 46.33, 55.53],
    4. 'B': [50, 100, 150, 200, 250, 300]}
    5. df = pd.DataFrame(data)
    6. df.set_index('UH', inplace=True)
    7. df.plot(kind='line', y='B', marker='o')
    8. plt.title('UH-B Is=1.00mA')
    9. plt.xlabel('UH (mV)')
    10. plt.ylabel('B (mT)')
    11. df_reset = df.reset_index()
    12. for i, txt in enumerate(df_reset['B']):
    13. plt.annotate(f'{ df_reset["B"][i],df_reset["UH"][i]}', (df_reset['UH'][i], df_reset['B'][i]), ha='center', va='bottom')
    14. plt.show()

    1. import pandas as pd
    2. import matplotlib.pyplot as plt
    3. data = {'B': [14.1, 71.3, 128.4, 186.1, 243.4, 300.8, 357.6],
    4. 'IM': [0.04, 0.20, 0.36, 0.52, 0.68, 0.84, 1.00]}
    5. df = pd.DataFrame(data)
    6. df.set_index('B', inplace=True)
    7. df.plot(kind='line', y='IM', marker='o')
    8. plt.title('B-IM Is=1.00mA')
    9. plt.xlabel('B (mT)')
    10. plt.ylabel('IM (A)')
    11. df_reset = df.reset_index()
    12. for i, txt in enumerate(df_reset['IM']):
    13. plt.annotate(f'{ df_reset["IM"][i],df_reset["B"][i]}', (df_reset['B'][i], df_reset['IM'][i]), ha='center', va='bottom')
    14. plt.show()

     

  • 相关阅读:
    使用python获取城市经纬度以及城市间的距离、火车时间、所需成本等
    业界首创云原生安全检测双模型!安全狗重磅报告亮相数字中国建设峰会
    QT计时器QTime的使用举例
    8. JVM-堆
    Docker安装MongoDB和Redis
    JVM中一次完整的 GC 流程
    Android smartTable的简单使用
    百度飞桨(PaddlePaddle) - PaddleHub OCR 文字识别简单使用
    【我不熟悉的javascript】02. 使用token和refreshToken的管理用户登录状态
    程序员是怎么把自己从高端人士变成民工的
  • 原文地址:https://blog.csdn.net/timberman666/article/details/133616213