@@ -166,32 +166,25 @@ def get_plot(self, normalize_rxn_coordinate: bool = True, label_barrier: bool =
166166 plt.Axes: matplotlib axes object.
167167 """
168168 ax = pretty_plot (12 , 8 )
169- scale = 1 if not normalize_rxn_coordinate else 1 / self .r [- 1 ]
170- x = np .arange (0 , np .max (self .r ), 0.01 )
171- y = self .spline (x ) * 1000
169+ scale = 1 / self .r [- 1 ] if normalize_rxn_coordinate else 1
170+ xs = np .arange (0 , np .max (self .r ), 0.01 )
171+ ys = self .spline (xs ) * 1000
172172 relative_energies = self .energies - self .energies [0 ]
173- ax .plot (
174- self .r * scale ,
175- relative_energies * 1000 ,
176- "ro" ,
177- x * scale ,
178- y ,
179- "k-" ,
180- linewidth = 2 ,
181- markersize = 10 ,
182- )
183- ax .set_xlabel ("Reaction coordinate" )
173+ ax .plot (self .r * scale , relative_energies * 1000 , "ro" , xs * scale , ys , "k-" , linewidth = 2 , markersize = 10 )
174+
175+ ax .set_xlabel ("Reaction Coordinate" )
184176 ax .set_ylabel ("Energy (meV)" )
185- ax .set_ylim ((np .min (y ) - 10 , np .max (y ) * 1.02 + 20 ))
177+ ax .set_ylim ((np .min (ys ) - 10 , np .max (ys ) * 1.02 + 20 ))
186178 if label_barrier :
187- data = zip (x * scale , y )
179+ data = zip (xs * scale , ys )
188180 barrier = max (data , key = lambda d : d [1 ])
189- ax .plot ([0 , barrier [0 ]], [barrier [1 ], barrier [1 ]], "k--" )
181+ ax .plot ([0 , barrier [0 ]], [barrier [1 ], barrier [1 ]], "k--" , linewidth = 0.5 )
190182 ax .annotate (
191- f"{ np .max (y ) - np .min (y ):.0f} meV" ,
183+ f"{ np .max (ys ) - np .min (ys ):.0f} meV" ,
192184 xy = (barrier [0 ] / 2 , barrier [1 ] * 1.02 ),
193185 xytext = (barrier [0 ] / 2 , barrier [1 ] * 1.02 ),
194186 horizontalalignment = "center" ,
187+ fontsize = 18 ,
195188 )
196189 plt .tight_layout ()
197190 return ax
0 commit comments