On 2014/03/05 11:37 AM, Asma Riyaz wrote:
> Sorry I somehow forgot to paste the imshow call to plot the .png
> image(pasted the entire code again), I am trying the different
> interpolation parameters in the mean time as suggested by Pierre
>
> data=np.array(full_len)
> cmap = mpl.cm.hot
> if outlier==0:
> threshold=1
> else:
> threshold=outlier-0.01
>
> fig = plt.figure(figsize=(25,25))
> plt.suptitle(file_handle.replace('.csv',''),fontsize=22)
> cmap.set_over('green')
> cmap.set_under('grey')
> gs=gridspec.GridSpec(1, 2,height_ratios=[1,1,-2,2]
> ,width_ratios=[1,1,-2,2])
> gs.tight_layout(fig,)
> phyl_ax=plt.subplot(gs[0]) ##,frameon=False)##
> ht_ax=plt.subplot(gs[1],sharey=phyl_ax)
> ##gs.tight_layout(fig, rect=[1,1,2,2])
> ht_ax.set_xlim(0,35)
> ht_ax.set_ylim(0,35)
> ##ht_ax.grid(color='white',linestyle='-',linewidth=1)
> ##fig.subplots_adjust(hspace=0)
> cb_ax,kw =mpl.colorbar.make_axes(ht_ax, shrink=0.65)
>
> plt.setp(phyl_ax.get_xticklabels(),visible=False)
> plt.setp(phyl_ax.get_yticklabels(),visible=False)
> plt.setp(ht_ax.get_xticklabels(),visible=True)
> plt.setp(ht_ax.get_yticklabels(),visible=True)
> plt.setp(phyl_ax.get_xticklines(),visible=False)
> plt.setp(phyl_ax.get_yticklines(),visible=False)
> plt.setp(ht_ax.get_xticklines(),visible=True)
> plt.setp(ht_ax.get_yticklines(),visible=True)
>
>
> img = ht_ax.imshow(data, cmap=cmap,
> interpolation='none',vmax=threshold)
> cb = mpl.colorbar.ColorbarBase(ax=cb_ax,cmap=cmap,
> extend='neither',**kw)
> cb.cmap.set_over('green')
> ##image_file =
> cbook.get_sample_data('/home/asmariyaz/Desktop/mytree.png',asfileobj=False)
> ##image = plt.imread(image_file)
> img= mpimg.imread('/home/asmariyaz/Desktop/mytree.png')
> phyl_ax.imshow(img,interpolation='nearest')
>
> heatmap_file=fig.savefig('/home/asmariyaz/Desktop/heatmap/'+file_handle+'.pdf',bbox_inches='tight')
Try giving savefig a dpi kwarg to increase the resolution with which the
image is saved in the pdf? Turn off anti-aliasing when you make the png?
Eric
------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works.
Faster operations. Version large binaries. Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users