
The resulting sheet looks like this:ĬolourChartSequential and colourChartDivergent The other subs expect the colour map sheet in this format so I recommend you don't make any changes to it besides hiding the sheet. It will create a new sheet (named after your colour map text file) containing the hex values of your map in column A, the RGB values in columns B to D and a visualisation of the colour map in column F. You need to fill in a value for the variable filename which is the name of the text file with your colour map in it. The next step is to get that colour map out of the text file and into your spread sheet.
#Xy scatter plot excel how to#
If you are interested in the theory of how Chroma.js Color Scale Helper creates colour maps that are perceptual linear (and thus superior to interpolating in RGB or HSV space) read How To Avoid Equidistant HSV Colors and Mastering Multi-hued I highly recommend using ColorBrewer2.0 in order to choose sensible nodes. To create your own colour maps, I recommend using Chroma.js Color Scale Helper with no more than 5 colour 'nodes' specified. This file consists of a single line of space separated hex values in the form #000000. I have provided two example files which you can use, one for sequential data and one for divergent. The first step is to create a text file containing your colour map.


An example spreadsheet is also provided for demonstration.

Scatter plot using a diveregent colour mapĪll the code is in ChartColouring.bas. Scatter plot using a sequential colour map VBA code to colour xy-scatter charts in Excel according to a colour map as well as creating a dynamic colour bar.
