Beispiel #1
0
 def create_plot(self):
     """
     Create plot!
     """
     nrow = len(self.magnitudes)
     # Get means and standard deviations
     gmvs = self.get_ground_motion_values()
     fig = plt.figure(figsize=self.figure_size)
     fig.set_tight_layout({"pad":0.5})
     for rowloc in xrange(nrow):
         for colloc in xrange(self.nsites):
             self._build_plot(
                 plt.subplot2grid((nrow, self.nsites), (rowloc, colloc)), 
                 gmvs,
                 rowloc,
                 colloc)
     #fig.text(0.5, 0.0, "Period", fontsize=18, ha='center', va='center')
     #fig.text(0.0, 0.5, "Sa (g)", fontsize=18, ha='center', va='center',
     #         rotation='vertical')
     # Add legend
     lgd = plt.legend(self.lines,
                      self.labels,
                      loc=2,
                      bbox_to_anchor=(1.1, 1.))
     _save_image_tight(fig, lgd, self.filename, self.filetype, self.dpi)
     plt.show()
Beispiel #2
0
 def create_plot(self):
     """
     Creates the trellis plot!
     """
     # Determine the optimum number of rows and columns
     nrow, ncol = utils.best_subplot_dimensions(len(self.imts))
     # Get means and standard deviations
     gmvs = self.get_ground_motion_values()
     fig = plt.figure(figsize=self.figure_size)
     fig.set_tight_layout(True)
     row_loc = 0
     col_loc = 0
     first_plot = True
     for i_m in self.imts:
         if col_loc == ncol:
             row_loc += 1
             col_loc = 0
         # Construct the plot
         self._build_plot(
             plt.subplot2grid((nrow, ncol), (row_loc, col_loc)), 
             i_m, 
             gmvs)
         col_loc += 1
     # Add legend
     lgd = plt.legend(self.lines,
                      self.labels,
                      loc=2,
                      bbox_to_anchor=(1.1, 1.))
     #fig.savefig(self.filename, bbox_extra_artists=(lgd,),
     #            bbox_inches="tight",
     #            dpi=self.dpi, format=self.filetype)
     _save_image_tight(fig, lgd, self.filename, self.filetype, self.dpi)
     plt.show()
Beispiel #3
0
 def create_plot(self):
     """
     Creates the trellis plot!
     """
     # Determine the optimum number of rows and columns
     nrow, ncol = utils.best_subplot_dimensions(len(self.imts))
     # Get means and standard deviations
     if self.rupture:
         gmvs = self.get_ground_motion_values_from_rupture()
     else:
         gmvs = self.get_ground_motion_values()
     fig = plt.figure(figsize=self.figure_size)
     fig.set_tight_layout(True)
     row_loc = 0
     col_loc = 0
     first_plot = True
     for i_m in self.imts:
         if col_loc == ncol:
             row_loc += 1
             col_loc = 0
         # Construct the plot
         self._build_plot(
             plt.subplot2grid((nrow, ncol), (row_loc, col_loc)), i_m, gmvs)
         col_loc += 1
     # Add legend
     lgd = plt.legend(self.lines,
                      self.labels,
                      loc=2,
                      bbox_to_anchor=(1.05, 1.),
                      fontsize=self.legend_fontsize,
                      ncol=self.ncol)
     _save_image_tight(fig, lgd, self.filename, self.filetype, self.dpi)
     plt.show()
 def create_plot(self):
     """
     Create plot!
     """
     nrow = len(self.magnitudes)
     # Get means and standard deviations
     # if self.rupture:
     #    gmvs = self.get_ground_motion_values_from_rupture()
     # else:
     gmvs = self.get_ground_motion_values()
     fig = plt.figure(figsize=self.figure_size)
     fig.set_tight_layout({"pad": 0.5})
     for rowloc in xrange(nrow):
         for colloc in xrange(self.nsites):
             self._build_plot(plt.subplot2grid((nrow, self.nsites), (rowloc, colloc)), gmvs, rowloc, colloc)
     # Add legend
     lgd = plt.legend(self.lines, self.labels, loc=2, bbox_to_anchor=(1.1, 1.0))
     _save_image_tight(fig, lgd, self.filename, self.filetype, self.dpi)
     plt.show()
Beispiel #5
0
 def create_plot(self):
     """
     Create plot!
     """
     nrow = len(self.magnitudes)
     # Get means and standard deviations
     gmvs = self.get_ground_motion_values()
     fig = plt.figure(figsize=self.figure_size)
     fig.set_tight_layout({"pad": 0.5})
     for rowloc in xrange(nrow):
         for colloc in xrange(self.nsites):
             self._build_plot(
                 plt.subplot2grid((nrow, self.nsites), (rowloc, colloc)),
                 gmvs, rowloc, colloc)
     # Add legend
     lgd = plt.legend(self.lines,
                      self.labels,
                      loc=2,
                      bbox_to_anchor=(1.1, 1.),
                      ncol=self.ncol)
     _save_image_tight(fig, lgd, self.filename, self.filetype, self.dpi)
     plt.show()