comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » How do I place an image when I am using !P.Multi?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
How do I place an image when I am using !P.Multi? [message #88810] Mon, 23 June 2014 03:16 Go to previous message
atmospheric physics is currently offline  atmospheric physics
Messages: 121
Registered: June 2010
Senior Member
Hello,

I have a sky image file (.JPG). I am trying to plot with other subplots.

(a) I get a problem w.r.t the size of the sky image that is displayed (sub-plot#2) in the saved file. I see a very small image at the right top corner. How can I actually fit the image that is read in the exact position dimensions I have defined for the display?

(b) In sub-plot#4 I wanted to actually make a PDF (probability density function) for my data array. Is relative frequency that is displayed with the following code the same? If not, how can I actually obtain only PDF displayed?


Below is the code I wrote: (probably you can use some demo data to understand my problem!)

------------------------------------------------------------ -----
cgPS_Open,FigFileName,FONT=-1, CHARSIZE=0.6

; Setting variables to plot
thick = (!D.Name EQ 'PS') ? 2 : 1 ; Setup variable to the plot

; Display window
cgDisplay,XSIZE=2000,YSIZE=1500 ; Create a map projection space

!P.Multi=[0,2,2] ; 2 columns X 2 rows

pos1 = [0.05,0.49,0.5,0.89]
pos2 = [0.57,0.55,0.92,0.9]
pos3 = [0.07,0.1,0.5,0.40]
pos4 = [0.6,0.1,0.90,0.40]

; Sub-Plot#1



; Sub-Plot#2
READ_JPEG,SkyImgFile,img1,ORDER=1
cgImage,img1,/NOERASE,Position=pos2,/KEEP_ASPECT_RATIO

;Sub-Plot#3


;Sub-Plot#4

cgHistoplot,flux,/Frequency,/OProbability,ProbColorName='red ', $
ProbThick=2,PolyColor='dodger blue', /NAN, DataColorName='navy', $
POSITION=pos4,XTITLE='Flux in W/m^2', Charsize=0.85,$
/LINE_FILL,LINE_THICK=2,/OUTLINE,SMOOTH=1,THICK=2,XRange=[0. 0,1.2], $
FONT=-1,YRange=[0.0,0.5]

!P.Multi=0

cgPS_Close

; Create a PNG file with a width of 1500 pixels
cgPS2Raster,FigFileName,/PNG, Width=1500

-----------------------------------------------------------

Please let me know where I am going wrong!!!

Thanks in advance
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How can I use the shapefiles of a particular country in plotting the country boundaries?
Next Topic: A grid is overlaid on an image

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:34:25 PDT 2025

Total time taken to generate the page: 0.00433 seconds