X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 05 Mar 2014 08:45 AM by  anon
Colorbar get not minimum TAPER
 5 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
05 Mar 2014 08:45 AM
    Hi, I have a strong problem, to get a low value TAPER in the colorbar procedure in case where the contour field includes negative values. To demonstrate this is, I changed the example in the colorbar/taper documentation as seen in the attached example. The top figure produces both taper ends, the bottom figure produce only the upper taper. Any help is welcome Thomas idl code start -------------------------------------------------------------------------------------------------------------------- pro test file = FILEPATH('convec.dat', $ SUBDIR=['examples', 'data']) z = READ_BINARY(file,DATA_DIMS=[248,248]) fz=float(z) index = [0,30,60,90,120,150,220] c1 = CONTOUR(fz, /FILL, ASPECT_RATIO=1, DIM=[300,500], $ RGB_TABLE=39, RGB_INDICES=index, C_VALUE=index, $ LAYOUT=[1,2,1], AXIS_STYLE=0, MARGIN=0) ; Create a discrete colorbar with vertical orientation. ; The ends are automatically tapered for a filled contour. c1 = COLORBAR(TARGET=c1, TITLE='Convection', /BORDER, $ ORIENTATION=1, TEXTPOS=1, POSITION=[0.8,0.55,0.85,0.95]) c2 = CONTOUR(fz-10., /FILL, ASPECT_RATIO=1, DIM=[300,500], $ RGB_TABLE=39, RGB_INDICES=index, C_VALUE=index, $ LAYOUT=[1,2,2], AXIS_STYLE=0, MARGIN=0, /Current) ; Create a discrete colorbar with vertical orientation. ; The ends are automatically tapered for a filled contour. cb = COLORBAR(TARGET=c2, TITLE='Convection', /BORDER, $ ORIENTATION=1, TEXTPOS=1, POSITION=[0.8,0.05,0.85,0.45]) c1.save,'test.png',with=500 end

    Deleted User



    New Member


    Posts:
    New Member


    --
    06 Mar 2014 05:04 PM
    Dear Thomas, If you add the keyword TAPER=1 to the second call to COLORBAR, that should show both tapers: cb = COLORBAR(TARGET=c2, TITLE='Convection', /BORDER, $ ORIENTATION=1, TEXTPOS=1, POSITION=[0.8,0.05,0.85,0.45], TAPER=1) Can this help? Cheers, Fernando

    Deleted User



    New Member


    Posts:
    New Member


    --
    07 Mar 2014 05:47 AM
    Hi Fernando, thank you for your suggesttion. That is what I have tried first. However it has no effect. Specially because in IDL documentation was written: Note: By default, for a colorbar associated with a line contour plot, the colorbar has no tapered ends (TAPER=0). For a colorbar associated with a filled contour plot, the colorbar may have tapered ends. If the lowest contour level is equal to or lower than the lowest contour data value, then the left end will be tapered (TAPER=2). If the highest contour level is equal to or greater than the highest contour data value, then the right end will be tapered (TAPER=3). If both conditions are true then both ends will be tapered (TAPER=1). If neither condition is true then the ends will not be tapered (TAPER=0). See the example below. So far, this problem is still open. Cheers Thomas

    Deleted User



    New Member


    Posts:
    New Member


    --
    07 Mar 2014 10:57 AM
    Hi Thomas, Your example, after adding the TAPER to the last call, seems to work fine: pro colorbar_taper file = FILEPATH('convec.dat', $ SUBDIR=['examples', 'data']) z = READ_BINARY(file,DATA_DIMS=[248,248]) fz=float(z) index = [0,30,60,90,120,150,220] c1 = CONTOUR(fz, /FILL, ASPECT_RATIO=1, DIM=[300,500], $ RGB_TABLE=39, RGB_INDICES=index, C_VALUE=index, $ LAYOUT=[1,2,1], AXIS_STYLE=0, MARGIN=0) ; Create a discrete colorbar with vertical orientation. ; The ends are automatically tapered for a filled contour. cb1 = COLORBAR(TARGET=c1, TITLE='Convection', /BORDER, $ ORIENTATION=1, TEXTPOS=1, POSITION=[0.8,0.55,0.85,0.95]) c2 = CONTOUR(fz-10., /FILL, ASPECT_RATIO=1, DIM=[300,500], $ RGB_TABLE=39, RGB_INDICES=index, C_VALUE=index, $ LAYOUT=[1,2,2], AXIS_STYLE=0, MARGIN=0, /Current) ; Create a discrete colorbar with vertical orientation. ; The ends are automatically tapered for a filled contour. cb2 = COLORBAR(TARGET=c2, TITLE='Convection', /BORDER, $ ORIENTATION=1, TEXTPOS=1, POSITION=[0.8,0.05,0.85,0.45], taper=1) end Do you see the same? Cheers, fernando

    Deleted User



    New Member


    Posts:
    New Member


    --
    10 Mar 2014 03:02 AM
    Hi Fernado, ist seems to be that it is only my prbolem. When I run the script I got two plot including colorbars. The top one has taperd ends (upper and lower). The bottom colorbar has only an uper taper end. For comparison I store the result on my Dropbox. Please find the plot under: https://www.dropbox.com/sh/4z6abx2uz91olad/AytfuT7XmD I run IDL 8.2 on a suse linux mashine Thank you so far Thomas

    Deleted User



    New Member


    Posts:
    New Member


    --
    10 Mar 2014 08:36 AM
    Dear Thomas, I was wondering, could you write directly to Tech Support?, so that we can investigate further. Please, write to: support@exelisvis.com Thank you very much, Fernando
    You are not authorized to post a reply.