X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 14 Oct 2011 01:34 PM by  anon
IDLgrPATTERN HELP!
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
14 Oct 2011 01:34 PM
    so i have an image projected, and then another set of data being plotted over top.. I have the selected areas being contoured, which is what i want, but i dont want to solid fill it i want to fill it using a pattern. pattern = BYTE(RANDOMN(seed, 32, 4)*255) myPattern = OBJ_NEW('IDLgrPattern', 2, PATTERN=pattern) im2=contour(var2,position=[0.1,0.1,0.9,0.9],C_FILL_PATTERN=myPattern,$ grid_units=2,c_linestyle=0,n_levels=2,/overplot,/cell_fill) I dont know why its not working, all i get is the same contour, no pattern filling. even if i remove the /cell_fill, still nuthing. ANY ideas on why there is no pattern fill? Thanks Albert

    Deleted User



    New Member


    Posts:
    New Member


    --
    19 Oct 2011 09:21 AM
    You are creating your pattern array incorrectly. This has to be a 32x32 pattern of "bits", with each bit either a 1, indicating the bit is turned on, or a 0, indicating it is turned off. The CVTTOBM function will convert a 4x32 byte array (four bytes contain 32 bits) to the proper bitmap pattern array, but how in the world are you suppose to create that byte array!? The easiest way is to use the XBM_EDIT procedure to create a 32x32 bitmap. This procedure may be the least intuitive procedure ever written in the IDL language! It's interface goes against every user interface principle ever devised by humans. Nevertheless, most people would be lost creating a bitmap pattern without it. You will catch on after working with it for a day or two. :-) Fire it up like this: IDL> xbm_edit, xsize=32, ysize=32 Then, draw your "design". Go down to the bottom and change the filename to something you like. *Then* go to the File button and choose "Save IDL Array Definition File". This will create a text file that you can open in any text editor. This is the 4x32 byte array you are looking for that has your pattern embedded in it. Read this into an IDL variable, then convert that variable to a bit pattern with CVTTOBM and you are good to go. Load your bit pattern into IDLgrPattern with the PATTERN keyword.
    You are not authorized to post a reply.