Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
Hello! I have a great problem with the colors....!! We are working in developing a user-surface for IDL, in which you can draw xy-plots, countour-plots, surface-plots and so on. Normally, I want the colour of background white and the color of text, axes and so on black. The colormap for my data I want to use a spectrum from blue for the minimum data value (eg. z value at surface) and red for the highest value. But how can I use then white for my background and black for my text??? Next problem: if I work something with shades=bytscl(... what I have to specify, that he dont use my white and black in the colormap?? Next problem: I have e.g. a contour plot in and a surface in the same picture. But how can I get, that e.g. value 10 = yellow in my surface plot is the same in my countour plot?? Any help is welcome...!! Regards, Astrid Kuhr
Astrid Kuhr <a.kuhr@kfa-juelich.de> writes: > I have a great problem with the colors....!! You know, some days you wake up and it's like, "Wow, my prayers are answered. An IDL question I *know* how to answer!" > Normally, I want the colour of background white and the color > of text, axes and so on black. > The colormap for my data I want to use a spectrum from blue for > the minimum data value (eg. z value at surface) and red > for the highest value. > But how can I use then white for my background and black for my text??? Well, do this. Suppose you want to have 200 "data" colors, and then a couple of "drawing" colors for your background, plots, etc. First, let's build a color table that goes from blue to red. This is pretty easy. Here are 200 data colors going from pure blue at one end to pure red at the other end. blue = Congrid(Findgen(256), 200) blue = Reverse(blue) red = Congrid(Findgen(256), 200) green = FltArr(200) TVLCT, red, green, blue Now, let's have some "drawing colors". I want black (0,0,0), white(255,255,255), charcoal(70,70,70), and yellow(255,255,0). I want to load these colors "above" my drawing colors, starting at index 200. I do this: TVLCT, [0, 255, 70, 255], [0, 255, 70, 255], [0, 255, 70, 0], 200 Let's draw a surface in which the surface is shaded with the data colors, but I use a charcoal background and yellow axes. SURFACE, DIST(30), Background=202, Color=203, $ Shades=BYTSCL(DIST(30), TOP=199) > Next problem: I have e.g. a contour plot in and a surface in the same > picture. But how can I get, that e.g. value 10 = yellow in my surface > plot is the same in my contour plot?? !P.MULTI=[0, 2, 1] SURFACE, DIST(30), Background=202, Color=203, $ Shades=BYTSCL(DIST(30), TOP=199) CONTOUR, DIST(30), NLEVELS=12, Color=201, C_Color=203 This is good fodder for the "tips" section on my web page. I'll put it in with the other color stuff. Cheers! David ----------------------------------------------------------- David Fanning, Ph.D. Fanning Software Consulting 2642 Bradbury Court, Fort Collins, CO 80521 Phone: 970-221-0438 Fax: 970-221-4762 E-Mail: davidf@dfanning.com Coyote's Guide to IDL Programming: http://www.dfanning.com -----------------------------------------------------------