MCPcopy Create free account
hub / github.com/ayaabdelsalam91/TS-Interpretability-Benchmark / plotExampleBox

Function plotExampleBox

Scripts/Plotting.py:9–34  ·  view source on GitHub ↗
(input, saveLocation, show=False,greyScale=False,flip=False)

Source from the content-addressed store, hash-verified

7
8
9def plotExampleBox(input, saveLocation, show=False,greyScale=False,flip=False):
10
11 if(flip):
12 input=np.transpose(input)
13 fig, ax = plt.subplots()
14
15 if(greyScale):
16 cmap='gray'
17 else:
18 cmap='seismic'
19
20 plt.axis('off')
21
22 cax = ax.imshow(input, interpolation='nearest', cmap=cmap)
23
24 plt.gca().set_axis_off()
25 plt.subplots_adjust(top = 1, bottom = 0, right = 1, left = 0,
26 hspace = 0, wspace = 0)
27 plt.margins(0,0)
28 plt.gca().xaxis.set_major_locator(plt.NullLocator())
29 plt.gca().yaxis.set_major_locator(plt.NullLocator())
30 plt.savefig(saveLocation+'.png' , bbox_inches = 'tight',pad_inches = 0)
31
32 if(show):
33 plt.show()
34 plt.close()
35
36
37

Callers 4

mainFunction · 0.90
mainFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected