@@ -33,8 +33,10 @@ def __init__(self, figure: Figure, data_provider: DataProvider):
3333 self .data_provider = data_provider
3434
3535 @abstractmethod
36- def generate_figure (self , subplot_dir : Optional [str ] = None
37- ) -> Optional [Dict [str , plt .Subplot ]]:
36+ def generate_figure (
37+ self ,
38+ subplot_dir : Optional [str ] = None
39+ ) -> Optional [Dict [str , plt .Subplot ]]:
3840 pass
3941
4042
@@ -65,9 +67,12 @@ def _error_column_for_plot_type_data(plot_type_data: str) -> Optional[str]:
6567 return 'noise_model'
6668 return None
6769
68- def generate_lineplot (self , ax : 'matplotlib.pyplot.Axes' ,
69- dataplot : DataPlot ,
70- plotTypeData : str ) -> None :
70+ def generate_lineplot (
71+ self ,
72+ ax : 'matplotlib.pyplot.Axes' ,
73+ dataplot : DataPlot ,
74+ plotTypeData : str
75+ ) -> None :
7176 """
7277 Generate lineplot.
7378
@@ -82,7 +87,6 @@ def generate_lineplot(self, ax: 'matplotlib.pyplot.Axes',
8287 plotTypeData:
8388 Specifies how replicates should be handled.
8489 """
85-
8690 simu_color = None
8791 measurements_to_plot , simulations_to_plot = \
8892 self .data_provider .get_data_to_plot (dataplot ,
@@ -152,9 +156,12 @@ def generate_lineplot(self, ax: 'matplotlib.pyplot.Axes',
152156 label = label_base + " simulation" , color = simu_color
153157 )
154158
155- def generate_barplot (self , ax : 'matplotlib.pyplot.Axes' ,
156- dataplot : DataPlot ,
157- plotTypeData : str ) -> None :
159+ def generate_barplot (
160+ self ,
161+ ax : 'matplotlib.pyplot.Axes' ,
162+ dataplot : DataPlot ,
163+ plotTypeData : str
164+ ) -> None :
158165 """
159166 Generate barplot.
160167
@@ -200,9 +207,12 @@ def generate_barplot(self, ax: 'matplotlib.pyplot.Axes',
200207 color = 'white' , edgecolor = color , ** bar_kwargs ,
201208 label = 'simulation' )
202209
203- def generate_scatterplot (self , ax : 'matplotlib.pyplot.Axes' ,
204- dataplot : DataPlot ,
205- plotTypeData : str ) -> None :
210+ def generate_scatterplot (
211+ self ,
212+ ax : 'matplotlib.pyplot.Axes' ,
213+ dataplot : DataPlot ,
214+ plotTypeData : str
215+ ) -> None :
206216 """
207217 Generate scatterplot.
208218
@@ -215,7 +225,6 @@ def generate_scatterplot(self, ax: 'matplotlib.pyplot.Axes',
215225 plotTypeData:
216226 Specifies how replicates should be handled.
217227 """
218-
219228 measurements_to_plot , simulations_to_plot = \
220229 self .data_provider .get_data_to_plot (dataplot ,
221230 plotTypeData == PROVIDED )
@@ -228,9 +237,11 @@ def generate_scatterplot(self, ax: 'matplotlib.pyplot.Axes',
228237 label = getattr (dataplot , LEGEND_ENTRY ))
229238 self ._square_plot_equal_ranges (ax )
230239
231- def generate_subplot (self ,
232- ax ,
233- subplot : Subplot ) -> None :
240+ def generate_subplot (
241+ self ,
242+ ax : plt .Axes ,
243+ subplot : Subplot
244+ ) -> None :
234245 """
235246 Generate subplot based on markup provided by subplot.
236247
@@ -241,7 +252,6 @@ def generate_subplot(self,
241252 subplot:
242253 Subplot visualization settings.
243254 """
244-
245255 # set yScale
246256 if subplot .yScale == LIN :
247257 ax .set_yscale ("linear" )
@@ -270,7 +280,6 @@ def generate_subplot(self,
270280 for data_plot in subplot .data_plots :
271281 self .generate_scatterplot (ax , data_plot , subplot .plotTypeData )
272282 else :
273-
274283 # set xScale
275284 if subplot .xScale == LIN :
276285 ax .set_xscale ("linear" )
@@ -345,7 +354,6 @@ def generate_figure(
345354 None:
346355 In case subplots are saved to file.
347356 """
348-
349357 if subplot_dir is None :
350358 # compute, how many rows and columns we need for the subplots
351359 num_row = int (np .round (np .sqrt (self .figure .num_subplots )))
@@ -361,7 +369,7 @@ def generate_figure(
361369 axes = dict (zip ([plot .plotId for plot in self .figure .subplots ],
362370 axes .flat ))
363371
364- for idx , subplot in enumerate ( self .figure .subplots ) :
372+ for subplot in self .figure .subplots :
365373 if subplot_dir is not None :
366374 fig , ax = plt .subplots (figsize = self .figure .size )
367375 fig .set_tight_layout (True )
@@ -419,6 +427,8 @@ class SeabornPlotter(Plotter):
419427 def __init__ (self , figure : Figure , data_provider : DataProvider ):
420428 super ().__init__ (figure , data_provider )
421429
422- def generate_figure (self , subplot_dir : Optional [str ] = None
423- ) -> Optional [Dict [str , plt .Subplot ]]:
430+ def generate_figure (
431+ self ,
432+ subplot_dir : Optional [str ] = None
433+ ) -> Optional [Dict [str , plt .Subplot ]]:
424434 pass
0 commit comments