def save(self, filename='plot'): #'eps' workstation doesn't work reliably, but 'ps' is OK weps = Ngl.open_wks('ps', filename, self.WorkstationResources) Ngl.change_workstation(self.plot, weps) Ngl.draw(self.plot) Ngl.change_workstation(self.plot, self.workstation) Ngl.destroy(weps)
def save(self,filename = 'plot'): #'eps' workstation doesn't work reliably, but 'ps' is OK weps = Ngl.open_wks('ps',filename,self.WorkstationResources) Ngl.change_workstation(self.plot,weps) Ngl.draw(self.plot) Ngl.change_workstation(self.plot,self.workstation) Ngl.destroy(weps)
resources.xyExplicitLegendLabels = ["zo(i,2)","zo(i,4)","zo(i,6)","zo(i,8)"] resources.vpYF = 0.90 # Change size and location of plot. resources.vpXF = 0.18 resources.vpWidthF = 0.74 resources.vpHeightF = 0.74 resources.trYMaxF = 980 # Set the maximum value for the Y axes. resources.tiYAxisString = "Depth of a subsurface stratum" xy = Ngl.xy(xwks,xo,zt[2:9:2,:],resources) # Draw an XY plot. #----------- Draw to other workstations ------------------------------ Ngl.change_workstation(contour,cgmwks) # Change the workstation that the Ngl.change_workstation(xy,cgmwks) # contour and XY plot is drawn to. Ngl.draw(contour) # Draw the contour plot to the new Ngl.frame(cgmwks) # workstation and advance the frame. Ngl.draw(xy) # Draw the XY plot to the new Ngl.frame(cgmwks) # workstation and advance the frame. Ngl.change_workstation(contour,pswks) # Do the same for the PostScript Ngl.change_workstation(xy,pswks) # workstation. Ngl.draw(contour) Ngl.frame(pswks) Ngl.draw(xy) Ngl.frame(pswks) Ngl.change_workstation(contour,pdfwks) # And for the PDF workstation... Ngl.change_workstation(xy,pdfwks)
resources.xyExplicitLegendLabels = ["zo(i,2)", "zo(i,4)", "zo(i,6)", "zo(i,8)"] resources.vpYF = 0.90 # Change size and location of plot. resources.vpXF = 0.18 resources.vpWidthF = 0.74 resources.vpHeightF = 0.74 resources.trYMaxF = 980 # Set the maximum value for the Y axes. resources.tiYAxisString = "Depth of a subsurface stratum" xy = Ngl.xy(xwks, xo, zt[2:9:2, :], resources) # Draw an XY plot. #----------- Draw to other workstations ------------------------------ Ngl.change_workstation(contour, cgmwks) # Change the workstation that the Ngl.change_workstation(xy, cgmwks) # contour and XY plot is drawn to. Ngl.draw(contour) # Draw the contour plot to the new Ngl.frame(cgmwks) # workstation and advance the frame. Ngl.draw(xy) # Draw the XY plot to the new Ngl.frame(cgmwks) # workstation and advance the frame. Ngl.change_workstation(contour, pswks) # Do the same for the PostScript Ngl.change_workstation(xy, pswks) # workstation. Ngl.draw(contour) Ngl.frame(pswks) Ngl.draw(xy) Ngl.frame(pswks) Ngl.change_workstation(contour, pdfwks) # And for the PDF workstation... Ngl.change_workstation(xy, pdfwks)