为什么我看不到两点之间的实线?

时间:2018-08-24 11:05:01

标签: python python-3.x matplotlib

for循环中,我有两组数据点(x1,y1)(x2,y2)。我想在它们之间画一条线。为此,我的代码受到了打击,并附加了对此代码的响应。

import matplotlib.lines as mylines

fig, isc_check = plt.subplots()

for i,j in zip(IV_start_index,IV_start_index[1:]):  # This is simple code to access present and next element in a list        
    isc_act = module_allData_df['Current'].iloc[i:j-1].max()              
    isc_indx = module_allData_df['Current'].iloc[i:j-1].idxmax()         
    x = [module_allData_df['Voltage'].iloc[isc_indx],module_allData_df['Voltage'].iloc[j-1]]
    y = [isc_act,module_allData_df['Voltage'].iloc[j-1]]
    l = mlines.Line2D(x, y,color='r',marker='*')
    isc_check.add_line(l)

输出如下:

enter image description here

我的x数据字段的值的范围最大为8,而y数据字段的值的范围最大为15。有趣的是,图只显示了一小部分图。

  1. 请参阅x和y轴限制。它会自动仅显示1.0,而不显示实际数据吗?这有什么问题吗?

  2. 在图中,我实际上想在线的两端绘制不同的标记。一个标记位于(x1,y1),另一个标记位于(x2,y2)。在该图中,两个点都带有*标记。如何在两者上取得不同?

0 个答案:

没有答案
相关问题