Hi,

I have generated a heat map along side a tree with gridspec. The issue is
that I want the tree with smaller dimensions and heat map should be in a
square dimension, adjusting height ratios and width ration only helps
reduce tree and the heat map dimensions increase.

Here is my code:

    gs=gridspec.GridSpec(1, 2,height_ratios=[1,1,-2,2]
,width_ratios=[0.5,1,-2,2],hspace=0,wspace=0)
    phyl_ax=plt.subplot(gs[0,0])
    Phylo.draw(tree, axes=phyl_ax, do_show=False,show_confidence=False)
    ht_ax=plt.subplot(gs[0,1])

Hence I decided to use add_subplots instead:
from mpl_toolkits.axes_grid1 import make_axes_locatable,Size
from Bio import Phylo
    fig= plt.figure()
    phyl_ax=fig.add_subplot(1,2,1)
    ht_ax=fig.add_subplot(1,2,2)
    fig.subplots_adjust(hspace=0,wspace=0)
    divider1 = make_axes_locatable(phyl_ax)
    divider1.get_horizontal()[0] = Size.Fixed(5.0) # 10 inch
    divider1.get_vertical()[0] = Size.Fixed(10.0) # 4 inch
    Phylo.draw(tree, axes=phyl_ax, do_show=False,show_confidence=False)
    divider2 = make_axes_locatable(ht_ax)
    divider2.get_horizontal()[0] = Size.Fixed(10.0) # 5 inch
    divider2.get_vertical()[0] = Size.Fixed(10.0) # 5 inch
    divider = make_axes_locatable(ht_ax)
    cbax = divider.append_axes("right", size="5%", pad=0.10)

Note:The width of the subplots is what I am trying to make different
and height should be the same.

With the above code the tree subplot is appearing in the background and
heat map on top of it, rather than adjacent.

Could anyone help me out with this?

Thanks
Asma
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to