@@ -166,32 +166,25 @@ def get_plot(self, normalize_rxn_coordinate: bool = True, label_barrier: bool =
166
166
plt.Axes: matplotlib axes object.
167
167
"""
168
168
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
172
172
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" )
184
176
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 ))
186
178
if label_barrier :
187
- data = zip (x * scale , y )
179
+ data = zip (xs * scale , ys )
188
180
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 )
190
182
ax .annotate (
191
- f"{ np .max (y ) - np .min (y ):.0f} meV" ,
183
+ f"{ np .max (ys ) - np .min (ys ):.0f} meV" ,
192
184
xy = (barrier [0 ] / 2 , barrier [1 ] * 1.02 ),
193
185
xytext = (barrier [0 ] / 2 , barrier [1 ] * 1.02 ),
194
186
horizontalalignment = "center" ,
187
+ fontsize = 18 ,
195
188
)
196
189
plt .tight_layout ()
197
190
return ax
0 commit comments