diff --git a/config/plot_porkchop.json.empty b/config/plot_porkchop.json.empty index 3350787..ba1389d 100644 --- a/config/plot_porkchop.json.empty +++ b/config/plot_porkchop.json.empty @@ -22,6 +22,9 @@ // display more or less details. If 0 no cutoff is assumed. "transfer_deltaV_cutoff" : 0, + // Indicate if plotting should be done with interpolation (countourf) or not (pcolormesh). + "interpolation" : false, + // Plot title or not, title includes information on the plot but isn't desired for publication. // Give "True" if title is desired, "False" if not. "title" : "", diff --git a/python/plot_porkchop.py b/python/plot_porkchop.py index f23c3ff..563344c 100644 --- a/python/plot_porkchop.py +++ b/python/plot_porkchop.py @@ -127,7 +127,17 @@ cmap = plt.get_cmap(config['colormap']) fig=plt.figure() ax1 = fig.add_subplot(111) -data = ax1.contourf(y1,x1,z,cmap=cmap) + +if config['interpolation']==True: + data = ax1.contourf(y1,x1,z,cmap=cmap) + +if config['interpolation']==False: + y2 = np.row_stack((y1,y1[-1]+(y1[-1]-y1[-2]))) + y3 = np.column_stack((y2,y2[:,-1])) + x2 = np.column_stack((x1,x1[:,-1]+(x1[:,-1]-x1[:,-2]))) + x3 = np.row_stack((x2,x2[-1])) + data = ax1.pcolormesh(y3,x3,z,cmap=cmap) + cbar = plt.colorbar(data, cmap=cmap) formatter = matplotlib.ticker.ScalarFormatter(useOffset=False) ax1.xaxis.set_major_formatter(formatter)