Madhavan Bomidi
2014-06-23 10:16:33 UTC
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
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