begin ; ; Define four dummy data sets (for four XY plots). ; npts = 101 y = new((/4,npts/),float) y(0,:) = sin(3.14159*fspan(0.,20.,npts)/2.) y(1,:) = sin(3.14159*fspan(0.,20.,npts)/4.) y(2,:) = sin(3.14159*fspan(0.,20.,npts)/8.) y(3,:) = sin(3.14159*fspan(0.,20.,npts)/16.) ; ; Define the X and Y positions in the viewport of each XY plot. ; (0.,0.) represents the lower left corner and (1.,1.) represents ; the upper right corner of the viewport. The (x,y) position that you ; specify is the position for the upper left corner of the plot, so ; a position of (0.10,0.90) will place the upper left corner of the plot ; in the upper left corner of the viewport. A position of (0.60,0.45) ; will place the upper left corner of the plot at roughly the middle of ; the viewport (slightly below and to the right of the middle). ; xpos = (/0.10, 0.60, 0.10, 0.60/) ypos = (/0.90, 0.90, 0.45, 0.45/) ; ; Create an X workstation. ; wid = create "xyplots" xWorkstationClass defaultapp end create ; ; Create arrays to hold the data and plot objects. ; dataid = new(4,graphic) plotid = new(4,graphic) ; ; Loop through the four plots, create each one, and draw it. ; do i = 0,3 dataid(i) = create "data" coordArraysClass defaultapp "caYArray": y(i,:) end create plotid(i) = create "plot" xyPlotClass wid "vpXF" : xpos(i) "vpYF" : ypos(i) "vpWidthF" : 0.35 ; The width and height is the same for "vpHeightF" : 0.35 ; each plot. "xyCoordData" : dataid(i) "tiMainString" : "Plot " + i + " (" + xpos(i) + "," + ypos(i) + ")" end create draw(plotid(i)) end do ; ; Advance the frame. ; frame(wid) end