X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 21 Jul 2015 08:34 AM by  anon
rainbow colour plot
 3 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
21 Jul 2015 08:34 AM
    Hey all, I am defining a function where I need to plot pitch angle for 9 energy values. I also need 9 colours with a while background for that, so I have done : my_padplot_both,pd,COLOR=INTGEN(9),UNITS='flux',EBINS=[0L,8L] where pd is the calculation of pitch angle distribution function. and Color,units and Ebins are key words. where COLOR is an [N]-Element array of colors to be used for each bin [N = EBINS[1] - EBINS[0] + 1L] That is the color keyword should be an array of long/integers specifying the colors associated with each energy bin value. NOw where am I going wrong ? I still couldn't produce a color plot. please help me.

    Zachary Norman



    Basic Member


    Posts:173
    Basic Member


    --
    21 Jul 2015 01:03 PM
    Hi Cibi, After some quick searching on the web, it looks like my_padplot_both is a third party program from here. This means that you will need to get in contact with the author of the code who is listed on the previous link. You could probably take a look at the pro code for my_padplot_both and try to change that for what you need.

    Deleted User



    New Member


    Posts:
    New Member


    --
    22 Jul 2015 08:04 AM
    Hi Zach, Yes this is where I am using the program from. But what I need to know is how to make the define the color table in an array, in that function. I contacted the author and he said the color keyword should be an array of long/integers specifying the colors associated with each energy bin value. I defined it this way: my_padplot_both,pd,COLOR=LINDGEN(diffen)*(250L - 30L)/(diffen - 1L) + 30L,UNITS='flux',EBINS=[0L,8L] There is no problem in other part of this routine. Just that it should automatically produce rainbow colour plot. It didnt so i tried to insert the integer with the color key word. There is even no problem with the way i get the COLOR=LINDGEN(diffen)... function as I could still get the black and white plot witout any error. I suume that somewhere in changing the numbers in the color keyword, I will get color plot. Do you think I should use something like 39 or 13 for the rainbow colour ? I tried it but it doesnt work :(

    Zachary Norman



    Basic Member


    Posts:173
    Basic Member


    --
    22 Jul 2015 03:59 PM
    Hi Cibi, Have you tried using the colortable function (http://www.exelisvis.com/docs/COLORTA...)? I think this may be what you are looking for, and here is an example of how to use it. It will return an array of RGB vectors for colors depending on the number of colors that you want. I hope this helps! IDL> colortable(39, ncolors = 7) 0 68 0 0 135 255 255 0 0 161 255 255 131 255 0 204 255 110 0 0 255
    You are not authorized to post a reply.