1

有没有办法将模式放置到 imshow 图表上的选定区域?准确地说,我需要做到这一点,除了带有数字数据的彩色方块之外,我在其他方块中也有不同的图案,表示实验的不同故障模式(并且还生成一个解释这些含义的密钥不同的图案)。一个有用的模式示例是各种类型的交叉影线。我需要能够在不破坏图表上主要颜色-数字数据关系的情况下做到这一点。

由于我正在为包含图形的 GUI 工作的后端,我无法使用补丁(它们无法腌制并通过多处理包从后端到前端)。我想知道是否有人知道另一种方法来做到这一点。

grid = np.ma.array(grid, mask=np.isnan(grid))
ax.imshow(grid, interpolation='nearest', aspect='equal', vmax = private.vmax, vmin = private.vmin)
# Up to here works fine and draws the graph showing only the data with white spaces for any point that failed
if show_fail and faildat != []:
    faildat = faildat[np.lexsort((faildat[:,yind],faildat[:,xind]))]
    fails = []
    for i in range(len(faildat)):  #gives coordinates with failures as (x,y)
        fails.append((faildat[i,1],faildat[i,0]))
    for F in fails:
         ax.FUNCTION NEEDED HERE
ax.minorticks_off()
ax.set_xticks(range(len(placex)))        
ax.set_yticks(range(len(placey)))
ax.set_xticklabels(placex)        
ax.set_yticklabels(placey, rotation = 0)
ax.colorbar()
ax.show()
4

0 回答 0