1717
1818
1919cm = 1 / 2.5
20+ TEXTWIDTH = 11.9446244611 * cm
2021
2122
2223def get_stats (problem , path = 'data/stats' ):
@@ -50,7 +51,7 @@ def get_stats(problem, path='data/stats'):
5051
5152def my_setup_mpl (** kwargs ):
5253 setup_mpl (reset = True , font_size = 8 )
53- mpl .rcParams .update ({'lines.markersize' : 8 })
54+ mpl .rcParams .update ({'lines.markersize' : 6 })
5455
5556
5657def savefig (fig , name , format = 'pdf' , base_path = 'data/paper' ): # pragma: no cover
@@ -98,7 +99,7 @@ def compare_strategies(stats_analyser, **kwargs): # pragma: no cover
9899 None
99100 """
100101 my_setup_mpl ()
101- fig , ax = plt .subplots (figsize = (16 * cm , 7 * cm ))
102+ fig , ax = plt .subplots (figsize = (TEXTWIDTH , 5 * cm ))
102103 stats_analyser .compare_strategies (ax = ax )
103104 savefig (fig , 'compare_strategies' , ** kwargs )
104105
@@ -114,7 +115,7 @@ def plot_recovery_rate(stats_analyser, **kwargs): # pragma: no cover
114115 None
115116 """
116117 my_setup_mpl ()
117- fig , axs = plt .subplots (1 , 2 , figsize = (16 * cm , 7 * cm ), sharex = True , sharey = True )
118+ fig , axs = plt .subplots (1 , 2 , figsize = (TEXTWIDTH , 5 * cm ), sharex = True , sharey = True )
118119 stats_analyser .plot_things_per_things (
119120 'recovered' , 'bit' , False , op = stats_analyser .rec_rate , args = {'ylabel' : 'recovery rate' }, ax = axs [0 ]
120121 )
@@ -167,7 +168,7 @@ def compare_recovery_rate_problems(): # pragma no cover
167168 titles = ['Van der Pol' , 'Lorenz attractor' , r'Schr\"odinger' ]
168169
169170 my_setup_mpl ()
170- fig , axs = plt .subplots (1 , 3 , figsize = (16 * cm , 5.5 * cm ), sharex = False , sharey = True )
171+ fig , axs = plt .subplots (1 , 3 , figsize = (TEXTWIDTH , 4 * cm ), sharex = False , sharey = True )
171172
172173 plot_recovery_rate_recoverable_only (vdp_stats , fig , axs [0 ], ylabel = 'recovery rate' )
173174 plot_recovery_rate_recoverable_only (lorenz_stats , fig , axs [1 ], ylabel = '' , xlabel = '' )
@@ -206,13 +207,14 @@ def plot_efficiency_polar(problem, path='data/stats'): # pragma no cover
206207 mask = stats_analyser .get_mask () # get empty mask, potentially put in some other mask later
207208
208209 my_setup_mpl ()
209- fig , ax = plt .subplots (subplot_kw = {'projection' : 'polar' }, figsize = (8 * cm , 8 * cm ))
210+ fig , ax = plt .subplots (subplot_kw = {'projection' : 'polar' }, figsize = (7 * cm , 7 * cm ))
210211
211212 res = {}
212213 for strategy in stats_analyser .strategies :
213214 dat = stats_analyser .load (strategy = strategy , faults = True )
214215 dat_no_faults = stats_analyser .load (strategy = strategy , faults = False )
215216
217+ mask = stats_analyser .get_fixable_faults_only (strategy = strategy )
216218 fail_rate = 1.0 - stats_analyser .rec_rate (dat , dat_no_faults , 'recovered' , mask )
217219 iterations_no_faults = np .mean (dat_no_faults ['total_iteration' ])
218220
@@ -259,7 +261,7 @@ def plot_adaptivity_stuff(): # pragma no cover
259261 stats_analyser = get_stats (run_vdp , 'data/stats' )
260262
261263 my_setup_mpl ()
262- fig , axs = plt .subplots (3 , 1 , figsize = (10 * cm , 11 * cm ), sharex = True , sharey = False )
264+ fig , axs = plt .subplots (3 , 1 , figsize = (TEXTWIDTH , TEXTWIDTH ), sharex = True , sharey = False )
263265
264266 def plot_error (stats , ax , iter_ax , strategy , ** kwargs ):
265267 """
@@ -328,9 +330,9 @@ def plot_fault_vdp(bit=0): # pragma no cover
328330 )
329331
330332 my_setup_mpl ()
331- fig , ax = plt .subplots (1 , 1 , figsize = (10 * cm , 7 * cm ))
333+ fig , ax = plt .subplots (1 , 1 , figsize = (TEXTWIDTH * 3.0 / 4.0 , 5 * cm ))
332334 colors = ['blue' , 'red' , 'magenta' ]
333- ls = ['--' , '--' , '-' , '- ' ]
335+ ls = ['--' , '-' ]
334336 markers = ['*' , '.' , 'y' ]
335337 do_faults = [False , True ]
336338 superscripts = ['*' , '' ]
0 commit comments