66axis_font = {'fontname' :'Arial' , 'size' :'8' , 'family' :'serif' }
77fs = 8
88
9- # setup = 'HEAT'
9+ #setup = 'HEAT'
1010setup = 'ADVECTION'
1111
1212list = [(setup + '_steps_vs_iteration_hf_NOFAULT.npz' ,'NOFAULT' ,'no fault' ,'k' ,'^' ),
7979 plt .savefig (fname , bbox_inches = 'tight' )
8080 os .system ('pdfcrop ' + fname + ' ' + fname )
8181
82-
83- fig , ax = plt .subplots (figsize = (15 ,10 ))
82+ #
83+ #
84+ #
85+ rcParams ['figure.figsize' ] = 6.0 , 3.0
86+ fig , ax = plt .subplots ()
8487maxiter = 0
8588lw = 2
86- ms = 10
89+ ms = 8
8790
8891
8992for file ,strategy ,label ,color ,marker in list :
105108
106109xvals = range (1 ,maxiter + 1 )
107110plt .plot (xvals ,[- 9 for i in range (maxiter )],'k--' )
108- plt .annotate ('tolerance' ,xy = (1 ,- 9.4 ),fontsize = 24 )
111+ plt .annotate ('tolerance' ,xy = (1 ,- 9.4 ),fontsize = fs )
109112
110113left = 6.15
111114bottom = - 12
115118top = bottom + height
116119rect = plt .Rectangle (xy = (left ,bottom ),width = width ,height = height ,color = 'lightgrey' )
117120plt .text (0.5 * (left + right ),0.5 * (bottom + top ),'node failure' ,horizontalalignment = 'center' ,
118- verticalalignment = 'center' ,rotation = 90 , color = 'k' ,fontsize = 24 )
121+ verticalalignment = 'center' ,rotation = 90 , color = 'k' ,fontsize = fs )
119122fig .gca ().add_artist (rect )
120123
121124plt .xlim (1 - 0.25 ,maxiter + 0.25 )
122125plt .ylim (minres - 0.25 ,maxres + 0.25 )
123126
124- plt .xlabel ('iteration' )
125- plt .ylabel ('log10(residual)' )
127+ plt .xlabel ('iteration' , ** axis_font )
128+ plt .ylabel ('log10(residual)' , ** axis_font )
129+ ax .xaxis .labelpad = 0
130+ ax .yaxis .labelpad = 0
131+ plt .tick_params (axis = 'both' , which = 'major' , labelsize = fs )
126132
127- plt .legend (numpoints = 1 )
133+ plt .legend (numpoints = 1 , fontsize = fs )
128134
129135plt .xticks (range (1 ,maxiter + 1 ))
130136plt .yticks (range (minres ,maxres + 1 ))
131137
132- ax .tick_params (pad = 8 )
138+ ax .tick_params (pad = 2 )
133139
134140plt .tight_layout ()
135141
136- fname = setup + '_residuals_allstrategies.png'
137- plt .savefig (fname , rasterized = True , transparent = True , bbox_inches = 'tight' )
142+ fname = setup + '_residuals_allstrategies.pdf'
143+ plt .savefig (fname , bbox_inches = 'tight' )
144+ os .system ('pdfcrop ' + fname + ' ' + fname )
138145
139146# plt.show()
0 commit comments