I have an issue to display the filled contours while is overly on another image. Currently it display me the unfilled contours. any comment would appreciated.
plt.imshow(t_image.detach().cpu().squeeze(), cmap='gray')
plt.contourf(filter_canny_predicted, colors='red')
plt.contourf(filter_canny_mask, colors='green')
plt.autoscale()
plt.show()
the above snippet will display this image which is not filled contours.
based on answer in here
I added set_rasterized to the snippet and couldn't figure out for both contours and also my background image gone. this is snippet when I tried for the filled contour with rasetrized
fig, (ax1) = plt.subplots(nrows=1, ncols=1, sharex=True, sharey=True)
ax1.imshow(t_image.detach().cpu().squeeze(), cmap='gray')
cs = ax1.contourf(filter_canny_predicted)
css = ax1.contourf(filter_canny_mask)
ax1.axis('on')
ax1.autoscale()
#ax1.tight_layout(pad=0.01, w_pad=0.002, h_pad=1)
for c in cs.collections:
c.set_rasterized(True)
for cc in css.collections:
cc.set_rasterized(True)
plt.show()
and it produce this image which is not my requirement.
in order to clarify the filter_canny_predicted
is red one and filter_canny_mask
is yellow one.