# ============= Import data from selected output file ======== from csv import reader def load_file(filename) : global col, ncol col = [] if filename == '': filename = input('>>> Give full path and filename of datafile? ') sel = reader(open(filename), delimiter='\t') line = next(sel) ncol = len(line) for i in range(ncol) : col.append([]) col[i].append(line[i]) for line in sel : for i in range(ncol - 1) : if (line[i] != ' '): col[i].append(eval(line[i])) # ============ Plot ========================================= from pylab import * # right click the phreeqc user_graph, save as \temp\curves.u_g # load_file("\\temp\\curves.u_g") load_file('') # enter \temp\curves.u_g for i in range(0, ncol - 1, 2): if i < ncol - 3: plot(col[i][1:], col[i + 1][1:], label = str(col[i + 1][0])) else: plot(col[i][1:], col[i + 1][1:], 'o', mec = 'b', mew = 1, mfc = 'None', aa = 'True', linestyle = 'None', markevery = 2, ms = 5, label = str(col[i + 1][0])) # legend(); axis([0, 2.5, 0, 1.3]) xlabel('Pore Volumes', size = 16); ylabel('mmol / kgw', size = 16) suptitle('Matplotlib', color = 'r', size = 18) show()