f



draw horizontal line on heatmap

Hi,

I'm trying to draw horizontal line on a heatmap. Tried the following but it didn't work:
ho = HeatMap(data);
plot(ho)
hold on
plot([28 28],[-10,300],'r');

Any idea?
0
C
2/24/2011 4:57:05 PM
comp.soft-sys.matlab 211052 articles. 13 followers. lunamoonmoon (258) is leader. Post Follow

10 Replies
840 Views

Similar Articles

[PageSpeed] 53

On 2/24/2011 10:57 AM, C T wrote:
> Hi,
>
> I'm trying to draw horizontal line on a heatmap. Tried the following but
> it didn't work:
> ho = HeatMap(data);
> plot(ho)
> hold on
> plot([28 28],[-10,300],'r');
>
> Any idea?

Yeah, your x vector is a constant.  That would be a vertical line, not 
horizontal.  W/O knowing the ranges of ho can't tell whether the values 
chosen are appropriate or not.

--

0
dpb
2/24/2011 5:28:25 PM
On Feb 24, 11:57=A0am, "C T" <u...@doramail.com> wrote:
> Hi,
>
> I'm trying to draw horizontal line on a heatmap. Tried the following but =
it didn't work:
> ho =3D HeatMap(data);
> plot(ho)
> hold on
> plot([28 28],[-10,300],'r');
>
> Any idea?

--------------------------
Is ho a 2D image?  Or a 1D array of y values?
You can also use line() instead of plot().
I think like this (untested):
    xlimits =3D xlim;
    line([xlimits(1) xlimits(2)], [yValue yValue]);
where yValue is the y value where you want the horizontal line placed.
0
ImageAnalyst
2/24/2011 9:32:43 PM
"C T" <usro@doramail.com> wrote in message <ik62l1$jva$1@fred.mathworks.com>...
> Hi,
> 
> I'm trying to draw horizontal line on a heatmap. Tried the following but it didn't work:
> ho = HeatMap(data);
> plot(ho)
> hold on
> plot([28 28],[-10,300],'r');
> 
> Any idea?

For horizontal lines (with a constant y-value!) you can use REFLINE

h = refline(0, 28) ; 
set(h,'color','r','linewidth',5)

~ Jos
0
Jos
2/25/2011 9:20:24 AM
On Feb 25, 4:20=A0am, "Jos (10584) " <#10...@fileexchange.com> wrote:
> For horizontal lines (with a constant y-value!) you can use REFLINE
>
> h =3D refline(0, 28) ;
> set(h,'color','r','linewidth',5)
>
> ~ Jos
---------------------------------------------------------------------------=
----
Sounds convenient, but I don't have it.  What toolbox is it in?
0
ImageAnalyst
2/25/2011 12:53:37 PM
ImageAnalyst <imageanalyst@mailinator.com> wrote in message <8965467a-fa41-4fa2-b6de-15cc1b66579d@z3g2000prz.googlegroups.com>...
> On Feb 25, 4:20 am, "Jos (10584) " <#10...@fileexchange.com> wrote:
> > For horizontal lines (with a constant y-value!) you can use REFLINE
> >
> > h = refline(0, 28) ;
> > set(h,'color','r','linewidth',5)
> >
> > ~ Jos
> -------------------------------------------------------------------------------
> Sounds convenient, but I don't have it.  What toolbox is it in?

REFLINE is a function the statistics toolbox, but it is basically nothing more than

line(get(gca,'xlim'), [Y Y],'b-') ;

~ Jos
0
10584 (931)
2/25/2011 2:06:05 PM
Ok. First of all thank you for all your replies. But I probably didn't convey my question correctly.

I cannot find a way to draw a line on top of a heatmap. Any line.
Using the usual hold on doesn't work.
0
usro (18)
2/25/2011 4:04:05 PM
On Feb 25, 11:04=A0am, "C T" <u...@doramail.com> wrote:
> Ok. First of all thank you for all your replies. But I probably didn't co=
nvey my question correctly.
>
> I cannot find a way to draw a line on top of a heatmap. Any line.
> Using the usual hold on doesn't work.

------------------------------------------------------------------
OK, go ahead.  What are you waiting for? Convey your question as
correctly, completely, and explicitly as you can.  This may include
uploading screenshots of what you require to your favorite file
hosting web site.
0
imageanalyst (7623)
2/25/2011 4:06:52 PM
data = gallery('invhess',20);
hmo = HeatMap(data)
plot(hmo);
hold on;
plot([5 5],[1 20],'k','linewidth',5);

The line is not on the heatmap!

I simply want a line imposed on a heatmap!
0
usro (18)
2/25/2011 4:17:19 PM
Sorry I can't run it because I don't have the HeatMap() function.
What toolbox is it in?  Or did you write it yourself?

If I do this, it certainly does draw a line:

data = gallery('invhess',20);
image(data);
hold on;
plot([5 5],[1 20],'k','linewidth',5);
0
ImageAnalyst
2/25/2011 4:30:42 PM
ImageAnalyst <imageanalyst@mailinator.com> wrote in message <7d23e64d-1db5-41f5-b54a-625e81b5e61c@8g2000prb.googlegroups.com>...
> Sorry I can't run it because I don't have the HeatMap() function.
> What toolbox is it in?  Or did you write it yourself?
> 
> If I do this, it certainly does draw a line:
> 
> data = gallery('invhess',20);
> image(data);
> hold on;
> plot([5 5],[1 20],'k','linewidth',5);

It's bioinformatics toolbox.
I know it works on image. But I just can't draw a line on top of heatmap.
0
C
2/25/2011 11:17:07 PM
Reply: