Belle II Software light-2405-quaxo
Multiplot Class Reference
Inheritance diagram for Multiplot:
Collaboration diagram for Multiplot:

Public Member Functions

def __init__ (self, cls, number_of_plots, figure=None)
 
def add (self, i, *args, **kwargs)
 
def finish (self)
 

Public Attributes

 figure
 create figure
 
 sub_plots
 the subplots which are displayed in the grid
 
 axis
 the axis of the first subplot
 

Static Public Attributes

None figure = None
 figure which is used to draw
 
None axis = None
 Main axis.
 

Detailed Description

Plots multiple other plots into a grid 3x?

Definition at line 481 of file plotting.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  cls,
  number_of_plots,
  figure = None 
)
Creates a new figure if None is given, sets the default plot parameters
@param figure default draw figure which is used

Reimplemented from Plotter.

Definition at line 490 of file plotting.py.

490 def __init__(self, cls, number_of_plots, figure=None):
491 """
492 Creates a new figure if None is given, sets the default plot parameters
493 @param figure default draw figure which is used
494 """
495 if figure is None:
496
497 self.figure = matplotlib.figure.Figure(figsize=(32, 18))
498 self.figure.set_tight_layout(True)
499 else:
500 self.figure = figure
501
502 if number_of_plots == 1:
503 gs = matplotlib.gridspec.GridSpec(1, 1)
504 elif number_of_plots == 2:
505 gs = matplotlib.gridspec.GridSpec(1, 2)
506 elif number_of_plots == 3:
507 gs = matplotlib.gridspec.GridSpec(1, 3)
508 else:
509 gs = matplotlib.gridspec.GridSpec(int(numpy.ceil(number_of_plots / 3)), 3)
510
511
512 self.sub_plots = [cls(self.figure, self.figure.add_subplot(gs[i // 3, i % 3])) for i in range(number_of_plots)]
513
514 self.axis = self.sub_plots[0].axis
515 super().__init__(self.figure, self.axis)
516

Member Function Documentation

◆ add()

def add (   self,
  i,
args,
**  kwargs 
)
Call add function of ith subplot
@param i position of the subplot

Reimplemented from Plotter.

Definition at line 517 of file plotting.py.

517 def add(self, i, *args, **kwargs):
518 """
519 Call add function of ith subplot
520 @param i position of the subplot
521 """
522 self.sub_plots[i].add(*args, **kwargs)
523

◆ finish()

def finish (   self)
Sets limits, title, axis-labels and legend of the plot

Reimplemented from Plotter.

Definition at line 524 of file plotting.py.

524 def finish(self):
525 """
526 Sets limits, title, axis-labels and legend of the plot
527 """
528 for plot in self.sub_plots:
529 plot.finish()
530 return self
531
532

Member Data Documentation

◆ axis [1/2]

None axis = None
static

Main axis.

Definition at line 488 of file plotting.py.

◆ axis [2/2]

axis

the axis of the first subplot

Definition at line 514 of file plotting.py.

◆ figure [1/2]

None figure = None
static

figure which is used to draw

Definition at line 486 of file plotting.py.

◆ figure [2/2]

figure

create figure

Definition at line 497 of file plotting.py.

◆ sub_plots

sub_plots

the subplots which are displayed in the grid

Definition at line 512 of file plotting.py.


The documentation for this class was generated from the following file: