Thread Subject:
how to make a heatmap like Nasdaq dynamic one?

Subject: how to make a heatmap like Nasdaq dynamic one?

From: Benjamin

Date: 7 Sep, 2012 14:35:08

Message: 1 of 2

Hi all,

I have the following two 7*8 matrices at hand:
Ticker =

    'LLY' 'COP' 'HMC' 'C' 'NFLX' 'BAC' 'STP' 'TOT'
    'NOK' 'PG' 'TM' 'LVMUY' 'UTX' 'BIDU' 'TSLA' 'DDAIF'
    'RIMM' 'KO' 'T' 'BHP' 'AMD' 'SINA' 'MSFT' 'PTR'
    'BK' 'WMT' 'CSCO' 'QCOM' 'NWSA' 'DANG' 'SAP' 'PEP'
    'SAN' 'JNJ' 'AXP' 'NSC' 'MCD' 'YOKU' 'SI' 'BCS'
    'AIG' 'GE' 'LNKD' 'BBVA' 'SBUX' 'RENN' 'MET' 'LYG'
    'COH' 'F' 'AVP' 'HRL' 'POT' 'QIHU' 'JPM' 'HBC'

and the corresponding returns figuresTotalReturns =

    0.0718 -0.2670 0.0174 0.0476 -0.1903 0.3203 -0.9822 -0.0510
   -0.6003 0.0054 0.1610 0.1023 0.0672 -0.1091 0.0155 0.0253
   -0.8409 -0.6288 0.1874 -0.1277 -0.3874 0.0090 0.1409 -0.0881
    0.0944 0.1851 0.0239 0.1062 0.2427 0.0381 0.1876 0.0869
   -0.0961 0.0233 0.1863 -0.0182 -0.0994 0.0060 -0.0571 0.0043
    0.3551 0.1204 0.5149 -0.1627 0.0911 0.0427 0.0632 0.2219
   -0.0323 -0.1753 -0.1365 -0.0159 -0.0628 0.3788 0.0599 0.1063

How can I make a heatmap that looks like the one from Nasdaq?
http://screening.nasdaq.com/heatmaps/nasdaq-100-heatmap.aspx

I tried imagesc and heatmap, both did not work.

Thank you very much.

Subject: how to make a heatmap like Nasdaq dynamic one?

From: Phil Goddard

Date: 10 Sep, 2012 18:41:09

Message: 2 of 2

There's no existing function that will do all of the heatmap (and displayed info) that you want, but all of the functionality exists to write your own.

imagesc is a good place to start.

Something like

imagesc(TotalReturns)
colorbar
for idx = 1:size(Tickers,1)
   for jdx = 1:size(Tickers,2)
      text(jdx,idx,Tickers{idx,jdx},'HorizontalAlignment','Center');
   end
end

will get the initial data plotted.
From there you need to read the doc related to Handle Graphics to understand how to further manipulate the image to get it to look like you want.

Phil.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
heatmap text figur... Benjamin 7 Sep, 2012 10:39:11
rssFeed for this Thread

Contact us