def plot_phase_diagram(pd, show_unstable=False): """ Plot phase diagram for an specific composite :param pd: :param show_unstable: """ plotter = PDPlotter(pd, show_unstable=show_unstable) plotter.show()
def plot(self, show_unstable=True, show=True): """ Plot phase diagram. Args: show_unstable (float): Whether unstable phases will be plotted as well as red crosses. If a number > 0 is entered, all phases with ehull < show_unstable will be shown. show: True to show plot. Return: plotter object. """ from pymatgen.analysis.phase_diagram import PDPlotter plotter = PDPlotter(self.phasediagram, show_unstable=show_unstable) if show: plotter.show() return plotter
for match, header in search: total_energy_result = match[0] print("Total energy for: " + str(total_energy_result.structure.formula) + " (" + total_energy_result.structure.uc_formula + ") " + " is " + str(total_energy_result.total_energy)) entries += [ ComputedEntry(str(total_energy_result.structure.uc_formula), float(total_energy_result.total_energy)) ] # import random # for i in range(100): # ca=random.choice(range(10)) # ti=random.choice(range(10)) # o=random.choice(range(10)) # s=ca+ti+o # form = 'Ca'+str(ca)+'Ti'+str(ti)+'O'+str(o) # entries += [ComputedEntry(form, random.randrange(-10,0)*s)] if len(entries) == 0: sys.exit( "entries list is empty! Your sqlite database is missing total energies." ) else: for row in entries: print(entries) pd = PhaseDiagram(entries) plotter = PDPlotter(pd, show_unstable=False) plotter.show()
def plot_pd(pd, show_unstable=False): plotter = PDPlotter(pd, show_unstable=show_unstable) # plotter = PDPlotter(pd, show_unstable=0.03) plotter.show()