tags:

views:

104

answers:

2

Hi there,

I am trying to plot some data in ipy. The data consists of three variables alpha,beta and delta. The alpha and beta values are the coordinates of the data points that I wish to plot using a hammer projection. I want to scale the colour of the markers according to the delta values, preferably in a rainbow scale colormap i.e. from red to blue. The delta values range from 0-13 and I want a linear colour correlation. Can anyone please help me, I am getting very frustrated.

Many thanks

Angela

A: 

Well i can\t quite get exactly what are you looking for, whole solution or maybe you've got problem with colors, if that second thing below you got some ideas

The most simple solution would be to create 14-elements array with color that you write from hand with help of some graphic software and than simply fetch element with delta number while drawing

You can also search some algorithm to draw gradient, but instead of drawing store its color to array, if you wil genrate 130 values then you can get your color like that

mycolors[delta*10]

Be more specific with your question, maybe then more people will abe bale to help you i hope that my answer in some way helps MTH

MoreThanChaos
hello thank you for your reply. I am having problem with the syntax as I am new to python. I can get the hammer plot up and previously I ordered the data into 14 different sets and plotted each in a different colour manually. However the delta values are not integers they are continuous, I would like to use more colours but do not want to set each one by hand.I have looked on Matplotlib at examples but they only show how to use a colour scale to plot a value that is a function of its position and nothing on a hammer plot. I am not sure if this is any clearer, I hope so though.Thank you
+2  A: 

You could use the HSV color space with fixed S (saturation) and V (value) values and a H (hue) value depending on delta (i.e. map 'delta' into the 0-360 degree range). Then convert the HSV color into a RGB color and plot it at (alpha,beta).

knweiss
thank you for your reply. I am having a problem with the syntax as I am new to python. I have looked at examples where they use a meshgrid but then the colour value is a function of position and the plot is not a hammer projection.