-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
270 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
from matplotlib import rc | ||
import matplotlib.pyplot as plt | ||
from matplotlib.ticker import AutoMinorLocator, MultipleLocator | ||
|
||
import os | ||
import sys | ||
sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/../Matplotlib_common/") | ||
|
||
from plot_ranges import xscaledict, yscaledict, xlimdict_series, ylimdict_series | ||
from plot_series import * | ||
|
||
# activate latex text rendering | ||
rc('text', usetex=True) | ||
|
||
Lasher_Trapp_vars = ["lwp", "rwp", "surf_precip", "acc_precip", "cl_nc"] | ||
|
||
# init the plot | ||
nplotx = 2 | ||
nploty= 3 | ||
fig, axarr = plt.subplots(nplotx,nploty) | ||
|
||
plot_series( Lasher_Trapp_vars, 0, nplotx, nploty, axarr, xscaledict, yscaledict, xlimdict_series, ylimdict_series, xlabel='Time [h]') | ||
|
||
# legend font size | ||
plt.rcParams.update({'font.size': 8}) | ||
|
||
# hide axes on empty plots | ||
if len( Lasher_Trapp_vars) % nploty == 0: | ||
nemptyplots = 0 | ||
else: | ||
nemptyplots = nploty - len( Lasher_Trapp_vars) % nploty | ||
emptyplots = np.arange(nploty - nemptyplots, nploty) | ||
for empty in emptyplots: | ||
axarr[nplotx-1, empty].axis('off') | ||
|
||
# hide hrzntl tic labels | ||
x_empty_label = np.arange(0, nplotx-1) | ||
y_empty_label = np.arange(nploty) | ||
for x in x_empty_label: | ||
for y in y_empty_label: | ||
axarr[x,y].set_xticklabels([]) | ||
|
||
#axes = plt.gca() | ||
#axes.tick_params(direction='in') | ||
x_arr = np.arange(nplotx) | ||
y_arr = np.arange(nploty) | ||
for x in x_arr: | ||
for y in y_arr: | ||
#tics inside | ||
axarr[x,y].tick_params(direction='in', which='both', top=1, right=1) | ||
#minor tics | ||
axarr[x,y].xaxis.set_minor_locator(AutoMinorLocator()) | ||
axarr[x,y].yaxis.set_minor_locator(AutoMinorLocator()) | ||
#labels and tics font size | ||
for item in ([axarr[x,y].xaxis.label, axarr[x,y].yaxis.label] + axarr[x,y].get_xticklabels() + axarr[x,y].get_yticklabels()): | ||
item.set_fontsize(8) | ||
# subplot numbering | ||
if y < nploty - nemptyplots or x < (nplotx - 1): | ||
axarr[x,y].text(0.2, 0.9, labeldict[y + x*nploty], fontsize=8, transform=axarr[x,y].transAxes) | ||
|
||
#single legend for the whole figure | ||
handles, labels = axarr[0,0].get_legend_handles_labels() | ||
|
||
lgd = fig.legend(handles, labels, handlelength=4, loc='lower center', bbox_to_anchor=(0.45,0)) | ||
|
||
#figure size | ||
fig.set_size_inches(7.874, 5. + (len(labels) - 2) * 0.2)# 5.214)#20.75,13.74) | ||
#distances between subplots and from bottom of the plot | ||
fig.subplots_adjust(bottom=0.18 + (len(labels) - 2) * 0.03, hspace=0.1, wspace=0.4) | ||
|
||
#fig.tight_layout(pad=0, w_pad=0, h_pad=0) | ||
|
||
#plt.show() | ||
fig.savefig(argv[len(sys.argv)-1], bbox_inches='tight', dpi=300)#, bbox_extra_artists=(lgd,)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
xscaledict = { | ||
"thl" : "linear", | ||
"00rtot" : "linear", | ||
"rliq" : "linear", | ||
"prflux" : "linear", | ||
"cl_nc" : "linear", | ||
"clfrac" : "linear", | ||
"wvar" : "linear", | ||
"w3rd" : "linear", | ||
"sat_RH" : "linear", | ||
"rad_flx" : "linear", | ||
"lwp" : "linear", | ||
"rwp" : "linear", | ||
"er" : "linear", | ||
"wvarmax" : "linear", | ||
"surf_precip" : "linear", | ||
"acc_precip" : "linear", | ||
"cloud_base" : "linear", | ||
"gccn_rw_cl" : "linear", | ||
"non_gccn_rw_cl" : "linear", | ||
"base_prflux_vs_clhght" : "log", | ||
"cl_gccn_conc" : "linear" | ||
} | ||
|
||
yscaledict = { | ||
"thl" : "linear", | ||
"00rtot" : "linear", | ||
"rliq" : "linear", | ||
"prflux" : "linear", | ||
"cl_nc" : "linear", | ||
"clfrac" : "linear", | ||
"wvar" : "linear", | ||
"w3rd" : "linear", | ||
"sat_RH" : "linear", | ||
"rad_flx" : "linear", | ||
"lwp" : "linear", | ||
"rwp" : "linear", | ||
"er" : "linear", | ||
"wvarmax" : "linear", | ||
"surf_precip" : "linear", | ||
"acc_precip" : "linear", | ||
"cloud_base" : "linear", | ||
"gccn_rw_cl" : "linear", | ||
"non_gccn_rw_cl" : "linear", | ||
"base_prflux_vs_clhght" : "linear", | ||
"cl_gccn_conc" : "log" | ||
} | ||
|
||
xlimdict_profs = { | ||
"thl" : None, | ||
"00rtot" : None, | ||
"rliq" : None, | ||
"prflux" : (0,20), | ||
"cl_nc" : (0,90), | ||
"clfrac" : None, | ||
"wvar" : None, | ||
"w3rd" : None, | ||
"sat_RH" : None, | ||
"rad_flx" : None, | ||
"gccn_rw_cl" : (0,90), | ||
"non_gccn_rw_cl" : (0,12), | ||
"base_prflux_vs_clhght" : (1,10000) | ||
} | ||
|
||
ylimdict_profs = { | ||
"thl" : (0,3000), | ||
"00rtot" : (0,3000), | ||
"rliq" : (0,3000), | ||
"prflux" : (0,3000), | ||
"cl_nc" : (0,3000), | ||
"clfrac" : (0,3000), | ||
"wvar" : (0,3000), | ||
"w3rd" : (0,3000), | ||
"sat_RH" : (0,3000), | ||
"rad_flx" : (0,3000), | ||
"gccn_rw_cl" : (0,3000), | ||
"non_gccn_rw_cl" : (0,3000), | ||
"base_prflux_vs_clhght" : (0,2500) | ||
} | ||
|
||
xlimdict_series = { | ||
"clfrac" : None, | ||
"cl_nc" : None, | ||
"lwp" : None, | ||
"rwp" : None, | ||
"er" : None, | ||
"wvarmax" : None, | ||
"surf_precip" : None, | ||
"acc_precip" : None, | ||
"cl_gccn_conc" : None, | ||
"cloud_base" : None | ||
} | ||
|
||
ylimdict_series = { | ||
"clfrac" : None, | ||
"cl_nc" : None, | ||
"lwp" : None, | ||
"rwp" : None, | ||
"er" : None, | ||
"wvarmax" : None, | ||
"surf_precip" : None, | ||
"acc_precip" : None,#(0,0.07), | ||
"cl_gccn_conc" : (1e-6, 1), | ||
"cloud_base" : None | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
a539105
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lasher_Trapp plotting option