FSC_color and loadct clashing - Idl-pvwave

This is a discussion on FSC_color and loadct clashing - Idl-pvwave ; Hi, I've spent some time today making contour plots. Huge thanks for David Fanning for his routines. I have struck a problem! I really want my contour plot to have the Hue Sat Lightness (loadCT, 20) colours, but I want ...

+ Reply to Thread
Results 1 to 4 of 4

FSC_color and loadct clashing

  1. Default FSC_color and loadct clashing

    Hi,

    I've spent some time today making contour plots.

    Huge thanks for David Fanning for his routines.

    I have struck a problem! I really want my contour plot to have the Hue
    Sat Lightness (loadCT, 20) colours, but I want a black set of axes
    inclusive of colorbar. Currently running windows and plotting to
    screen, but need to plot to 'x' and 'ps' also.

    Thus, my code has:

    ; getting contours sorted
    levels = 25
    step = (maxz - minz) / levels
    userLevels = IndGen(levels) * step + minz

    loadct, 20

    black = FSC_Colors('black')

    device, decomposed = 0

    Window, 0, Title='Display Output', XSize=800, YSize=600

    Contour, powerspec, x, y, /Fill, Position=[0.07, 0.1, 0.9, 0.90], $
    Levels=userLevels, yrange = [0, 1], zrange = [minz, maxz], xrange =
    [0, max(x)], $
    xstyle = 1, ytitle = 'Frequency (Hz)', xtitle = 'Time', color = black

    colorbar, Title='Power (dB)', Range=[minz,maxz], vertical = 1, $
    Position = [0.92, 0.1, 0.94, 0.9], right = 1, divisions = 4, color =
    black


    The problem is, there's a black line through my colorbar at the
    equivalent of black (in this case green) for color table 20. If I
    reverse the loadct and FSC_color commands, everything gets wrapped in
    a green box.

    Any idea how I can make my axes & labels black without getting a black
    line through my colorbar?

    Thanks.

    Russell.


  2. Default Re: FSC_color and loadct clashing

    Isn't this one of those situations where you reserve a color or two at
    the end of the color scale, make one of those colors be black and then
    use that index (which is then something >= than !d.table_size) for
    your axes? If you want to frame your colorbar in a color that does
    not show up in the colorbar, then you will need to access a color
    which is not found in the colorbar.
    -Kevin


  3. Default Re: FSC_color and loadct clashing

    russell.grew@gmail.com writes:

    > I've spent some time today making contour plots.
    >
    > Huge thanks for David Fanning for his routines.
    >
    > I have struck a problem! I really want my contour plot to have the Hue
    > Sat Lightness (loadCT, 20) colours, but I want a black set of axes
    > inclusive of colorbar. Currently running windows and plotting to
    > screen, but need to plot to 'x' and 'ps' also.


    This article should explain it for you:

    http://www.dfanning.com/color_tips/lineinct.html

    But, really, with a contour plot like this, you should
    only be loading the contour colors into 25 slots in
    the color table:

    LoadCT, 20, Colors=25, Bottom=1

    and later:

    Contor, C_Colors=Indgen(25)+1, ...
    Colorbar, NColors=25, Bottom=1, ...

    Here is an article that explains why:

    http://www.dfanning.com/tips/contour_hole.html

    Cheers,

    David
    --
    David Fanning, Ph.D.
    Fanning Software Consulting, Inc.
    Coyote's Guide to IDL Programming: http://www.dfanning.com/
    Sepore ma de ni thui. ("Perhaps thou speakest truth.")

  4. Default Re: FSC_color and loadct clashing

    Thanks David.

    Its working now.


+ Reply to Thread

Similar Threads

  1. Javascript display issue in IE6 only - two js files clashing.
    By Application Development in forum Javascript
    Replies: 1
    Last Post: 11-29-2007, 05:28 PM
  2. error with fsc_color
    By Application Development in forum Idl-pvwave
    Replies: 7
    Last Post: 11-29-2007, 04:58 PM
  3. Clashing Interface methods
    By Application Development in forum Java
    Replies: 10
    Last Post: 08-27-2007, 06:10 PM
  4. Using FSC_COLOR with postscript devices
    By Application Development in forum Idl-pvwave
    Replies: 4
    Last Post: 08-16-2007, 04:44 PM