Exemple #1
0
 def plot_cre(self, filename, cmin=None, cmax=None, title=None):
     cmap = mpl.cm.get_cmap('viridis')
     SM = mpl.cm.ScalarMappable(norm=None, cmap=cmap)
     SM = mpl.cm.ScalarMappable(norm=None, cmap=cmap)
     colors = SM.to_rgba(np.linspace(0, 1, len(self.objects)))
     fig, ax = plt.subplots(1, 1, figsize=(12 / 2.54, 7 / 2.54))
     for nr, item in enumerate(self.objects):
         ax.loglog(
             item.frequencies,
             item.cre,
             '.-',
             color=colors[nr],
             label=self.labels[nr],
         )
     ax.set_xlim(*self.xlim)
     ax.set_ylabel(get_label('cre', 'meas', 'mathml'))
     ax.set_xlabel('frequency [Hz]')
     ax.set_ylim(cmin, cmax)
     if title is not None:
         ax.set_title(title)
     self._add_legend(ax)
     fig.tight_layout()
     fig.subplots_adjust(bottom=self.margin_bottom, top=0.9)
     fig.savefig(filename, dpi=300)
     plt.close(fig)
Exemple #2
0
 def plot_rpha(self, filename, pmin=None, pmax=None, title=None):
     """plot all resistance/resistivity phase spectra
     """
     cmap = mpl.cm.get_cmap('viridis')
     SM = mpl.cm.ScalarMappable(norm=None, cmap=cmap)
     colors = SM.to_rgba(np.linspace(0, 1, len(self.objects)))
     fig, ax = plt.subplots(1, 1, figsize=(12 / 2.54, 7 / 2.54))
     for nr, item in enumerate(self.objects):
         ax.semilogx(
             item.frequencies,
             -item.rpha,
             '.-',
             color=colors[nr],
             label=self.labels[nr],
         )
     ax.set_xlim(*self.xlim)
     ax.set_ylabel(get_label('rpha', 'meas', 'mathml'))
     ax.set_xlabel('frequency [Hz]')
     ax.set_ylim(pmin, pmax)
     if title is not None:
         ax.set_title(title)
     self._add_legend(ax)
     fig.tight_layout()
     fig.subplots_adjust(bottom=self.margin_bottom)
     fig.savefig(filename, dpi=300)
     plt.close(fig)