while 1: fileNos, fileList = filesFromList(strKey + "*") pfig = plt.figure(num=1, figsize=(10., 10.5)) #pfig = plt.figure(num=1, figsize=(6.,8.)) for fn in fileNos: pdict = dict() pdict['filename'] = fileList[fn] pdict['Cx'] = factorX pdict['Cy'] = factorY pdict['lm'] = linemode pdict['logOn'] = logOn pdict['revAxes'] = revAxes pdict['xlims'] = xlims pdict['ylims'] = ylims pfig = plotCiXY(pfig, pdict) if (labelsOn): pfig = userLabels(pfig) plt.grid(True) plt.legend(loc=0) if (saveFig): pfig.savefig(saveFig, format='jpg', dpi=200) plt.show() break
ROrig = np.zeros(2) dPx = np.array([(X[0, 1] - X[0, 0]), (Y[1, 0] - Y[0, 0])]) X = None Y = None Z = None C = None # Clear memory info = ''' Info: Dimensions [rows, cols] = {} Origin (top-left) [N,E] = {} Resolution [dX,dY] = {} '''.format(Rdims, ROrig, dPx) print(info) figDims = size * (Rdims[::-1].astype(float) / np.max(Rdims)) fig = plt.figure(num=1, figsize=figDims) fig = addImagePlot(fig, R, rasterfile, gridOn, limsOn) R = None if (labels): fig = userLabels(fig) if (not (save == '')): filename = rasterfile.split('/')[-1] # Remove the path in Linux system filename = filename.split('\\')[-1] # Remove the path in Windows system filename = filename.strip('.npz') + '.' + save fig.savefig(filename, format=save, dpi=args.dpi) plt.show()
#==========================================================# parser = argparse.ArgumentParser() parser.add_argument("strKey", help="Search string for collecting files.",nargs='?',\ default=".csv") parser.add_argument("--magy", help="Magnitude of all variables.", action="store_true",\ default=False) parser.add_argument("--yx", help="Reverse axes: plot(x,y) --> plot(y,x)", action="store_true",\ default=False) parser.add_argument("--labels", help="User specified labels.", action="store_true",\ default=False) parser.add_argument("--reuse", help="Reuse once specified variable selections.", action="store_true",\ default=False) #==========================================================# args = parser.parse_args() strKey = args.strKey while 1: fileNos, fileList = filesFromList("*" + strKey + "*") pfig = pl.figure(num=1, figsize=(8.5, 8.5)) for fn in fileNos: pfig = plotCSV(pfig, fileList[fn], args.yx, args.magy, args.reuse) if (args.labels): pfig = userLabels(pfig) pl.grid(True) pl.legend(loc=0) pl.show()
header=hStr) else: hStr = ' {} at times = {}'.format(varList[iy], time[-1]) if (timeAverageOn): np.savetxt( varList[iy] + '_tavg.dat', np.c_[ xdict[xStr][:-1], np.transpose(np.nanmean(y[ tskip:, :-1], axis=0))], header=hStr) else: np.savetxt(varList[iy] + '.dat', np.c_[xdict[xStr][:-1], np.transpose(y[-1, :-1])], header=hStr) else: sys.exit( ' Plotting of profiles with more than one spatial dimension not supported.' ) if (noPlot): break else: if (labelsOn): fig = userLabels(fig) plt.legend(loc=0) plt.show() print(' Bye! ')