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


On Wed, Mar 5, 2014 at 3:27 PM, Pierre Haessig <pierre.haes...@crans.org>wrote:

>  Hi Asma,
> Le 05/03/2014 21:19, Asma Riyaz a écrit :
>
>  I am trying to merge a heat map(matplotlib) with a tree(.png), but the
> .png does not plot as needed or for that matter cannot be seen easily. Here
> is my code:
>
>  ####### CODE
>   [....]
>
>    img = ht_ax.imshow(data, cmap=cmap, interpolation='none',vmax=threshold)
>    [....]
>
>  How can I make the resolution of the .png image better OR for that
> matter is there a better solution to merge these together?
>
>   I see the imshow call to plot the matrix but not the one you use to
> plot the png image. Could it be that the poor image rendering is due to a
> bad choice for the interpolation param ?
>
> best,
> Pierre
>
>
> ------------------------------------------------------------------------------
> 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
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
------------------------------------------------------------------------------
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
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to