Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Matplotlib imshow而不使用面片的选择性图案_Matplotlib_Graphing - Fatal编程技术网

使用Matplotlib imshow而不使用面片的选择性图案

使用Matplotlib imshow而不使用面片的选择性图案,matplotlib,graphing,Matplotlib,Graphing,是否有办法将图案放置到imshow图形上的选定区域?准确地说,我需要这样做,除了携带彩色方块的数字数据外,我在其他方块中也有不同的图案,指示实验的不同故障模式(并生成一个键来解释这些不同图案的含义)。一个有用的模式示例是各种类型的交叉图案填充。我需要能够做到这一点,而不中断图形上的主颜色数字数据关系 由于我正在为包含图形的GUI工作的后端,我无法利用补丁(它们无法pickle并通过多处理包从后端到前端)。我想知道是否有人知道另一种方法 grid = np.ma.array(grid, mask=

是否有办法将图案放置到imshow图形上的选定区域?准确地说,我需要这样做,除了携带彩色方块的数字数据外,我在其他方块中也有不同的图案,指示实验的不同故障模式(并生成一个键来解释这些不同图案的含义)。一个有用的模式示例是各种类型的交叉图案填充。我需要能够做到这一点,而不中断图形上的主颜色数字数据关系

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

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()

我编写了实验性的酸洗功能。也许我们可以解决根本问题,这样您就可以使用补丁来解决这个问题(这正是它们的设计初衷)。你可以添加一些代码来突出显示失败的补丁吗?只需在此处需要的功能处添加补丁即可。我一直在尝试矩形。这就是说,这是我正在使用的包(pythics)的一个特定问题,所以我不确定它是否普遍适用。另一方面,错误来自pythics调用的多处理包,因此这可能是一个潜在问题。
p=patches.Rectangle(F,1,1,hatch='/',fill=False)
ax.add_patch(p)
是我一直在尝试的