X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 27 Sep 2011 08:17 PM by  anon
TV, PLOT positions do not coincide well
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
27 Sep 2011 08:17 PM
    I am writing a program in which I need to display an image within a set of axes (frequency vs. time with electric field power spectral density in color). The problem is that, while the position keyword specifies the lower left corner of the plotting region, the plot procedure draws the x and y axes on the inside of this space. So, when I plot my image using the same position that I supplied to the plotting routine, the image covers the x and y axes -- it is drawn on starting on the outer corner of the axes, not on the inner corner. This would be fine if the axes had a fixed width, but they do not. If I reposition or resize the plot, the axis width changes and the image does not fit snugly within the axes. Is there a trick to get around this? Perhaps a system variable that returns the pixel-width of the axes...? This happens no matter what coordinates I am using (device, normal, ...) position = [x0, y0, x1, y1] ;position in normal coordinates xsize = (position[2] - position[0]) * !d.x_vsize ysize = (position[3] - position[1]) * !d.y_vsize xstart = position[0] * !d.x_vsize ystart = position[1] * !d.y_vsize loadct, 13 plot, time, freq, position=position, /normal, /nodata, /noerase tvscl, congrid(alog(transpose(E_pwr_dens)), xsize, ysize), xstart, ystart

    Deleted User



    New Member


    Posts:
    New Member


    --
    29 Sep 2011 05:16 PM
    Hi Argallnaut, Could be ok for you to write a self-contained example so we can see what you mean, we will be able to see much easier what the problem is and give a solution. Cheers, Fernando

    Deleted User



    New Member


    Posts:
    New Member


    --
    30 Sep 2011 10:14 AM
    I have updated cgImage this morning so that the image falls completely within the axes that are placed around it. In other words, if you draw a set of axes, and then place the image on top of the axes, the axes will still be visible. You can find the updated version here: http://www.idlcoyote.com/programs/cgimage.pro You can test the program with code like this (Coyote Library required): Loadct, 0, NColors=20 cgImage, BytScl(Dist(20), TOP=19), /Axes, /Keep, $ Background='sky blue', /Erase, /Window
    You are not authorized to post a reply.