Heatmaps in Ruby

M

Marc Hoeppner

Hi,

I am currently thinking about doing a heatmap for data visualization,
but I have very little experience with any type of graphical tools in
ruby (like the various SVG libs etc).

So I was hoping someone could point me in the right direction and save
me some time trying out useless libraries ;) Doesn't have to be ruby
either, but that way I could probably integrate it more easily into my
analysis pipeline.

Thanks,

Marc
 
M

Michael Guterl

Hi,

I am currently thinking about doing a heatmap for data visualization,
but I have very little experience with any type of graphical tools in
ruby (like the various SVG libs etc).

So I was hoping someone could point me in the right direction and save
me some time trying out useless libraries ;) Doesn't have to be ruby
either, but that way I could probably integrate it more easily into my
analysis pipeline.
http://blog.revolution-computing.com/2009/11/charting-time-series-as-calendar-heat-maps-in-r.html

I think there are ruby bindings for R too, so that may help.

Best regards,
Michael Guterl
 
M

Marc Hoeppner

Hi,

thanks for the link - I suspected that R would probably have that
functionality. At this point I am simply curious how to do it in ruby.

I managed to write a simple program that uses RMagick to draw an
intensity map. It takes the highest observed value, sets it to 100% and
then draws other values in relation to that.

What I don't know is how to write a method that, based on a numerical
value, determines a color, i.e. from blue to red.

So if for example the value '1' should be a deep blue and '100' a bright
red - how would one do that? All color coding schemes allowed!

RMagick can draw colors using a cmyk notation (c,m,y,k) in percent as
well as rgb or the commonly found code in css files ala #00cc33 .

Am interested in all suggestions ;)
 
J

Jano Svitok

What I don't know is how to write a method that, based on a numerical
value, determines a color, i.e. from blue to red.

So if for example the value '1' should be a deep blue and '100' a bright
red - how would one do that? All color coding schemes allowed!

Hi,

what you are looking for is "color ramp" or "color gradient", there
are many sites with algorithms
how to compute colors between two or more given ones (for example from
blue to red).

J.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,164
Messages
2,570,898
Members
47,439
Latest member
shasuze

Latest Threads

Top