import numpy as np from matplotlib.colors import LinearSegmentedColormap import matplotlib.pyplot as plt import matplotlib as mpl import matplotlib.cbook as cbook from matplotlib._png import read_png from matplotlib.offsetbox import OffsetImage cmap = mpl.cm.hot norm = mpl.colors.Normalize(vmin=-1 * outlier, vmax=outlier) cmap.set_over('green') cmap.set_under('green') cmap.set_bad('green') plt.xlim(0,35) plt.ylim(0,35) fig, ax = plt.subplots() ax.set_aspect('equal') cb_ax=fig.add_axes([0.85, 0.1, 0.03, 0.8]) img = ax.imshow(np.ma.masked_values(data, outlier), cmap=cmap, norm=norm, interpolation='none',vmax=outlier) cb = mpl.colorbar.ColorbarBase(cb_ax, cmap=cmap, norm=norm, extend='both') ##axim = plt.subplot2grid(shape, loc, rowspan=1) ## phlo tree image_file = cbook.get_sample_data('mytree.png',asfileobj=False) image = plt.imread(image_file) phyl_ax=fig.add_axes([0.10,0.1, 0.03, 0.8]) phyl_ax.imshow(image,interpolation='nearest')/pre> The heat map looks like what I want it to but the .png won't show up properly Any idea how I could fix it? Thanks
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)