Heatmap Color Function for Visualizing Weighted Graphs

Recently, I needed a function to generate color values to reflect the relative intensity of numeric values in a range. Visualizations based on this idea are commonly called “Heatmaps”.

My requriement was to show the strength/weight of an edge between two adjacent graph nodes. See picture below:

I searched a bit on the internet but could not find a satisfactory answer so I wrote one in F#. You can find the color generation function in the F# Snippets library here:


BTW for graph layout, I am using WPF with Microsoft Automatic Graph Layout (available to MSDN subscribers).


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s