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 206981 articles. 0 followers. lunamoonmoon (258) is leader. Post Follow

10 Replies
569 Views

Similar Articles

[PageSpeed] 20
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 (932)
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:
Similar Artilces:

Drawing a zig-zag Trail in Python?
I'd like to draw something like an animal track. Between each point is a line. Perhaps the line would have an arrow showing the direction of motion. There should be x-y coordinates axises. PIL? MatPlotLib, ?? W. eWatson wrote: > I'd like to draw something like an animal track. Between each point is a > line. Perhaps the line would have an arrow showing the direction of > motion. There should be x-y coordinates axises. PIL? MatPlotLib, ?? Pycairo? mk wrote: > W. eWatson wrote: >> I'd like to draw something like an animal track. Between each point >> ...

what is hardware insert/delete line feature described in ncurses?
Hi all I can't catch the concept of "hardware insert/delete line feature"which described in ncurses's control subroutines. for example. Examples for the idlok subroutine are: 1.. To enable curses to use the hardware insert/delete line feature in stdscr, enter: idlok(stdscr, TRUE); 2.. To force curses not to use the hardware insert/delete line feature in the user-defined window my_window , enter: idlok(my_window, FALSE); so what is hardware insert/delete line feature ?thank you very much & best wishes your key9 In article <ee00fs$6fi$1@news.yaako.com>...

draw question
got similar question here. In MFC SDI, how to display content of a 10 bit BYTE* iData Buffer (1024*512) on screen?. ...

adding lines to UI edit text control
I am trying to programmatically add bits of text to an edit text box. It works fine, until I insert a new-line character. Then the next bit of text I add produces an "error using horzcat: All matrices on a row in the bracketed expression must have the same number of rows". If I manually insert text, including new-line characters (the enter key), it works fine. However, when I close the window containing the text box, and reopen it, trailing spaces are added to short lines. I assume these two behaviors are related. I don't need to manually add trailing spaces do I? ...

Line drawing
Hi I want to draw a line in a image, for example I = double(imread('myImage.jpg')); p1 = [1,1]; p2 = size(I); and a want to draw a line from p1 to p2 on image I. How can I do this? Is there a builtin function or do I have to write my own line drawing funtion, for example implement the Bresenham line drawing algorithm? goran wrote: > Hi > > I want to draw a line in a image, for example > > I = double(imread('myImage.jpg')); > p1 = [1,1]; > p2 = size(I); > > and a want to draw a line from p1 to p2 on image I. How can I do > this? Is there a bu...

Command Line Interface (CLI): your recommendations
Hello, All! I'm implementing simple CLI (flat model, no tree-style menu etc.). Command line looks like this: <command> <param1> <param2> ... <paramN> (where N=1..4) And idea is pretty simple: 1) get whole string of input line 2) preset table of strings matching <command> 3) preset table of function calls 4) scan <command> table for string, if match - call matching function (I declare ALL callback functions as having the same format) Here is code implementing part of this algorithm. The problem I came across is if pressing 'Enter' continuously ...

Hidden lines in a drawing view
I'm sure this is a basic question so forget me for my ignorance but if I RC on a line of a part in a drawing and make it hidden how do I get it back? Is there a reset option to bring the line back or some to this effect? Marty Select Menu "View" > "Hide/Show Anotations" and the hidden lines will show up in gray. Select the ones you want to un-hide by picking. Dave H marty wrote: > I'm sure this is a basic question so forget me for my ignorance but if I RC > on a line of a part in a drawing and make it hidden how do I get it back? > Is there a res...

User colored multi-line plots
Hello to all, how can I place two lines in the same plot with colors defined by me? The Help section suggested the following: set(0,'DefaultAxesColorOrder',[0 0 0;. . .;. . .]) but it doesn't seem to work. I also tried: plot(x,y,'Color',[1 0 1]) but ML gives an error message when I would like to plot two lines like: plot(x,y,'Color',[1 0 1],v,w,'Color',[0 0 1]) :( Any help would be greatly appreciated, G Hi, try this : plot(x,y,'m',v,w,'b') or h=plot(x,y,v,w,); set(h(1),'color',[1 0 1]) set(h(2),'color',[0 0 1])...

drawing outlines again-can I edit the installed drawing template?
Hi, I've been trying to do my own drawing outlines, with modicoms of success. But it seems to me that what I REALLY want to do is, once and for all, edit the original installed drawing template to suit my requirements. Then I can just start a new drawing, choose the size format etc, and all the bits I want are there ready for me. How/can I do this? Hi Me (strange opening) Open up the template You wanna modify.....rmb in the middle somewhere and take "edit sheet format"...do Your changes and then go to "file / save sheet format", save it in the same folder as You...

Thicker lines in VRML
Hi Folks, I need to draw lines with varying thickness using VRML, meaning some should look bold and some lean. Is it possible to do that? If yes, how to do that? I am not finding thickness option for index line set. Any clue would be of help. Thanks, Vasanth In article <c276d624-1e6b-4464-9ff6- 794b804a4ced@33g2000yqm.googlegroups.com>, pvasanthkumar@gmail.com () wrote: > Hi Folks, > > I need to draw lines with varying thickness using VRML, meaning > some should look bold and some lean. Is it possible to do that? If > yes, how to do that? I ...

Saving drawings and models
Is there any way to get rid of the nagging questions Solidworks asks over and over again? Example: "Some of the models referenced in this document have been modified. They must be saved when the document is saved. Save the document and the referenced models now?" Now, what kind of dumbass question is that? Of couse I want to save the models! That's what is supposed to happen when you "save"! This happens evertime you make a change in an assembly and try to save it. One would think there would be a way to turn off those nagging questions. ~Barry~ No, you need t...

Drawing to a window while it is moved
Hello I am writing a driver to do graphics for Seed7 (http://seed7.sourceforge.net) on windows. This driver is based on gdi32 and trys to hide the event loop from the rest of the program. My driver works but I have a problem: When I move a window it is not updated until the move ends. Other programs like the Task-Manager and Console windows are updated during the move. This is a functionality I want to do also with my driver. Currently my driver has the following behavior: When I click on the top border of the window the program receives a WM_NCLBUTTONDOWN message. The progr...

Draw a ring
Hi all! I need to draw a 3D ring in OpenGL... Where I can find an example of code to do this task? Thanks Riccardo "Riccardo Rossi" <shenron7@infinito.it> schrieb im Newsbeitrag news:9f168fff.0404270448.35103d8f@posting.google.com... > Hi all! > > I need to draw a 3D ring in OpenGL... Where I can find an example of > code to do this task? > > Thanks > Riccardo a Ring? 3D Line? glBegin(GL_LINES); for (phi=0; phi<=2*PI; phi+=PI/100.0) { glVertex3f(radius*sin(phi), radius*cos(phi), 0.0); } glEnd(); a "3D ring"? Donut/Torus? // By Samu...

Transmit in AWGN channel creating 10000 bits' message to do random and confirm BER and draw graph.
Transmit in AWGN channel creating 10000 bits' message to do random and confirm BER and draw graph. Length axis : BER width axis: SNR 1 bit Energy of utility is Eb AWGN mean 0, breakup No/2 Between SNR 1 ~ 6 1. When transmit BPSK 2. transmit BPSK after code using Hamming code in(7, 4) 3. transmit by QPSK 4. transmit QPSK after code using extended Hamming code in(8,4) Point message creation and AWGN creation to observe turn program about 4 case at the sun 1 times. Is not doing at all as I am beginner helps please ask please. ...

parsing a line in a file
Hi all, I am rading a file line by line. In this how to find out the number of words in that line? ex: 1) push pop (two words) 2) push (one word) regards Sree In article <e9936b79.0404280254.1bea2902@posting.google.com>, Sree <serverin2000@yahoo.com> wrote: >Hi all, > I am rading a file line by line. In this how to find out the number >of words in that line? > >ex: 1) push pop (two words) > 2) push (one word) . . . llength $line That's the simplest answer, and one that's likely to satisfy you for a while. It has many problems...

HP Laserjet 5 horizontal stripes
Hi everyone, I`ve had a HP Laserjet 5 printer for a while, and about 300 pages ago I put in a new toner. Suddenly today it has started laying down horizontal black lines, about 5mm in width, repeated every 9cm. Nothing has changed with the printer, it`s not been moved or knocked. As it started the lastest print job, which has these lines on, it started squaking rythmically as it was bringing the paper through. I`ve tried turning it off and on and swearing at it, as well as removing the toner cartridge and reseating. Any other ideas that might help, suggestions on a repair...

override grid drawing method
Hello! I need to change the way the grid is being drawn. The horizontal lines remain the same, but the vertical lines should become a kind of hyperbolas, rather than straight lines. How would you advise me to do that? Is it possible to change the way grid is being drawn? Or it is better for me to write a script that would draw the grid and call it after creating the figure but before plotting the data? Also I would like to know wheter there are any specific line styles used in plotting of the grid and whether I can use it somehow. Thanks for the answers. "Sergii " <s...

line-break in table-cell
Hello ! LaTeX2e - Is there an _easy_ way to achieve a line-break within a longtable-table-cell without having to specify the width like one would do when using some p-cells or parboxes? (The height of the whole row will increase of course.) Sincerely Sam "Samuel Fleischer" <LiveSucks@hotmail.com> wrote: > LaTeX2e - Is there an _easy_ way to achieve a line-break > within a longtable-table-cell without having to > specify the width like one would do when using > some p-cells ...

Running two silmultaneous instances of mathematica using a command line
We have Mathematica 5.0 for Windows running a real-time SPC manufacturing application. We can manually set two notebooks to run simultaneously in two separate instances of Mathematica. However, we would like to programmatically set up Mathematica so that an in-house scheduler program shutdowns and starts both Mathematica processes when any out-of-our-control situation occurs. When running our non-Mathematica scheduler, if we send to execute "Mathematica.exe first.nb" the application starts running first.nb successfully. If we send the second notebook to execute ("...

monitor noise and lines
I have a samsung chassis DP15LT. It worked fine for last two years. One it starts to give noise and horizontal line from top to bottom of the screen. If any other monitor is placed near (10 feets) this monitor, that monitor too affected by this noise and starts horizontal lines. There seems to be no default in the monitor parts. I doubt the EHT. Is is correct? how to correct this problem? Check the electrolytic capacitors on the main circuit board. I had one like this a few days ago. It started with a light grey bar waving at top then gradually fading out. There was noise in the background...

BOM (or make from) on Drawing
Does anyone have a macro or method to create a BOM or basically a make from on a part drawing. I want to show all inserted parts (bodies) in a BOM like format on a part drawing. And have it auto update if bodies are added or removed. I did find one that allowed you to enter in properties to fill out the BOM as you can put a normal BOM on a part's drawing. But this is a manual method, I would really like an auto one. Just thought I would ask before I started one myself. We also use a PDM (DBWorks) and I might find it easier to just get the data from there as it already does know about...

Freehand drawing in !Draw?
Hi, I've just been playing with my Wacom Artpad A6 and although it works great in PCAPaint and Paint, it's a total bear to use with Draw. Does anyone know of a program that would allow me to draw "freehand" in Draw, preferably using the graphics tablet? The tablet is a Wacom KT-0405-R with the Computer Concepts "CCTablet" driver, version 1.04 (16 Oct 1996). Also, does anyone know where I could get a replacement tip for the Artpad's "pen" from, if it's replaceable? Failing that, does anyone know of a company that still sells the pens for the A...

command line interface from ECS boot CD
I know there is a key-combo shortcut that brings up the commandline from an ECS 1.1 CD boot without going the long way around. I needed to reactivate bootmanager after an XP install. ....eric On Mon, 17 Jan 2005 12:14:26 -0500, eric w <eric@nospam.net> wrote: > I know there is a key-combo shortcut that brings up the commandline from an > ECS 1.1 CD boot without going the long way around. > > I needed to reactivate bootmanager after an XP install. Shift+F3. Some other lesser-known key commands in the eCS installer: F5: View hardware detection output (...

processing lines in a form
I have a multi line form that lets users paste in addresses for our internal mailing lists --- 30 to 50 addresses is average. I want to be able to add all of the names into the mysql table by looping through the list and adding each name after the form is posted. I am unable to locate a tutorial on getting this to work, so I suppose there must be a better way to do this without uploading a text file. Does anyone know how to do this in php? brian cole wrote: > I have a multi line form that lets users paste in addresses for our > internal mailing lists --- 30 to 50 addresses is ave...

Text export with line breaks
Is there a way to extract text from acroread display with line breaks? In the past this has worked but not now. So may be there is a configuration trick or it depends on something else I haven't tried. It's the same question again as someone has written in 1997: http://groups.google.com/groups?q=acroread+cop +text&hl=de&lr=&ie=UTF-8&group=comp.text.pdf&start=20&sa=N ideas? cheers Reimar -- Forschungszentrum Juelich email: R.Bauer@fz-juelich.de http://www.fz-juelich.de/icg/icg-i/ ================================================================== a IDL libr...