X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 15 Dec 2011 04:50 PM by  anon
Setting the size of an image in iImage from command line
 3 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:4
New Member


--
15 Dec 2011 04:50 PM
    Hi When I send an image to iImage there seems to be now way to resize it except by manually dragging a corner out. This approach is slow when I have a lot of figures to make and I can't control the exact size and aspect ratio of the image when I manually enlarge it. I would really like to be able to control the size of the image and color bar to be the same height and force the image pixels to be square. At the moment, I create the iImage window and alter its contents with the code below. The image_dimensions keyword seems to blow up the image, but then only a part of it gets displayed within the image object in the iTools window. Any help appreciated, Shane iImage,alog10(s_pdft),s_fx,s_fy, RGB_TABLE=ct,/SCALE_ISOTROPIC,xrange=[-0.5,0.5],yrange=[-0.5,0.5],dimensions=[800,800],/insert_colorbar,view_title='Periodogram' idTool = ITGETCURRENT(TOOL=oTool) idAxesContainer = oTool->FindIdentifiers('*AXES', /CONTAINER) void = oTool->DoSetProperty(idAxesContainer, 'STYLE', 2) idPlot = oTool->FindIdentifiers('*axes', /VISUALIZATIONS) succ = oTool->DoSetProperty(idPlot, 'THICK', 2) succ = oTool->DoSetProperty(idPlot, 'FONT_SIZE', 12) idPlot = oTool->FindIdentifiers('*axis2', /VISUALIZATIONS) succ = oTool->DoSetProperty(idPlot, 'AXIS_TITLE', 'Y-frequency') idPlot = oTool->FindIdentifiers('*axis0', /VISUALIZATIONS) succ = oTool->DoSetProperty(idPlot, 'AXIS_TITLE', 'X-frequency') idPlot = oTool->FindIdentifiers('*Colorbar',/ANNOTATIONS) succ = oTool->DoSetProperty(idPlot, 'AXIS_TITLE', 'Log!B10!N(Power)') succ = oTool->DoSetProperty(idPlot, 'ORIENTATION', 1) oTool -> CommitActions succ = oTool->DoSetProperty(idPlot, 'TEXTPOS',1) oTool -> CommitActions succ = oTool->DoSetProperty(idPlot, 'TEXTPOS',1) oTool -> CommitActions succ = oTool->DoSetProperty(idPlot, 'BORDER_ON',1) oTool -> CommitActions

    Deleted User



    New Member


    Posts:
    New Member


    --
    15 Dec 2011 10:55 PM
    Wow! You must be a masochist! :-) I'd try cgImage and cgColorbar from the Coyote Library: cgImage, image, Position=[0.1, 0.1, 0.9, 0.85], /Window cgColorbar, /Fit, Range=[Min(image),Max(image)], /AddCmd

    Deleted User



    New Member


    Posts:4
    New Member


    --
    16 Dec 2011 09:26 AM
    Thanks Dave. Well yes, I probably am a masochist... I'd like to use the iTools rather than direct graphics only because the axis label text looks so much nicer. Maybe postscript output is a better way to go for nice figures. I haven't done this in a few years, but I remember it being almost as painful as iTools. BTW, I just got your book on Traditional IDL graphics - great stuff! I'll try looking through that for the postscript option. Shane

    Deleted User



    New Member


    Posts:
    New Member


    --
    16 Dec 2011 09:37 AM
    Well, you are remembering the old days. :-) With Coyote Graphics you get fast rendering to the display, plus you get PostScript, PDF, and raster file output that is every bit as good as the lastest "new" graphics system in IDL. You can compare the quality of the output yourself in this article: http://www.idlcoyote.com/cg_tips/cgwfg.php What you won't find in the book, because this has just been added in the past couple of weeks, is the ability to create PostScript, PDF, and raster file out directly from any Coyote Graphics command, simply by using the Output keyword. cgImage, image, /Axes, Title='My Image Plot', Output='myimage.png' You can learn more about Coyote Graphics here: http://www.idlcoyote.com/cg_tips/cg_tips.php
    You are not authorized to post a reply.