X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 09 Oct 2006 10:44 AM by  anon
using icontour: specifying contour levels and drawing a color bar
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
09 Oct 2006 10:44 AM
    I am trying to make a greyscale contour by specifying contour levels to be drawn and colors to be used, but I run into a few problems when I use the following command: icontour,my_data,x_grid,y_grid,$ xtitle=my_xtitle,ytitle=my_ytitle,min_value=my_minval,$ xrange=[xmin,xmax],yrange=[ymin,ymax],/fill,$ c_value=my_contour_levels,rgb_indices=my_color_arr First, the combination of keywords c_value and rgb_indices gives me the following error message, and no contour is drawn: Unknown System Error: IDLGRCONTOUR::SETPROPERTY: Invalid internal color. Why does this not work? Second, I want to add a color bar to the contour plot, but the above command does not change value for "Use palette color" to "True" in the icontour interface, which would be needed. According to the IDL Help, setting keyword "rgb_indices" should activate the palette color mode. What am I doing wrong, or do I need to create the color bar manually?

    Deleted User



    New Member


    Posts:
    New Member


    --
    09 Oct 2006 10:44 AM
    What is wrong in the ICONTOUR call you show is the absence of the RGB_TABLE keyword. The Online Help for RGB_INDICES states: "The values set for RGB_INDICES are indices into the RGB_TABLE array of colors." The absence of an RGB_TABLE invalidates the RGB_INDICES setting and iTools then proceeds to start up in default full-color mode. That not only ruins your contour coloring at initialization, but also disables at initialization the availability of the Insert->Colorbar operation. Here is the correct approach, using some dummy data to demonstrate: IDL> data = dist(360) IDL> loadct, 5 ; Assuming this built-in STD GAMMA table was right for your data IDL> colorTable = bytarr(256,3) IDL> tvlct, colorTable, /GET IDL> icontour, data, /FILL, C_VALUE= findgen(5) *40. + 20., $ IDL> RGB_INDICES=bindgen(5) * 40b + 20b, RGB_TABLE=colorTable That old IDL command "TVLCT, /GET" is particularly handy for building the data for that iTools RGB_TABLE keyword. James Jones
    You are not authorized to post a reply.