Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7176111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:26:32+00:00 2026-05-28T16:26:32+00:00

I would like to generate a graph like the link below http://en.wikipedia.org/wiki/Reaction_coordinate The graph

  • 0

I would like to generate a graph like the link below

http://en.wikipedia.org/wiki/Reaction_coordinate

The graph generated from a calculation of the python library installed.
I would like the line is smooth with type cspline gnuplot

The values E_ads=234.4211 , E_dis=0.730278 and E_reac=-0.8714

Could anyone help me

from ase import *
from ase.calculators.jacapo import *
import Gnuplot as gp
# -- Read in all energies
datadict = {'H2O' :'water.nc',
            'Pt' :'out-Pt.nc',
            'H2OPt' :'H2O.Pt.nc',
            'OHPt' :'OHPt.nc',
            'HPt' :'HPt.nc',
}
E = {}

for label, file in datadict.items():
    print 'Reading energy for %5s from file %20s' % (label, file),
    atoms = Jacapo.read_atoms(file)
    E[label] = atoms.get_potential_energy()
    print '\tE = %14.6f eV'% E[label]
print     

# -- Calculate adsorption and disassociation energies
E_ads = (E['H2OPt'] - 2*E['H2O'] - E['Pt'])/2
print 'H2O adsorption energy on Pt:'
print 'E_ads =', E_ads, 'eV\n'

E_dis = E['HPt'] - E['Pt'] + E['OHPt'] - E['Pt'] - E['H2O']
print 'H2O -> OH + H disassociation energy on Pt:'
print 'E_dis =', E_dis, 'eV\n'

E_reac = E['H2OPt'] - E['HPt'] - E['OHPt'] + E['Pt']
print 'H2O@Pt -> OH@Pt +H@Pt reaction energy on Pt:'
print 'E_reac =', E_reac, 'eV\n'
# -- Collect reaction path
Epath = np.asarray([1.0, E_ads, E_dis, E_reac])
PathLabels= ['']
# -- Plot the reaction path
import pylab as p
import numpy as np
import matplotlib.path as mpath
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
from scipy.interpolate import spline
import matplotlib.pyplot as plt
from numpy import array, linspace
from scipy.interpolate import spline
fig = p.figure(1)
sp = p.subplot(1,1,1)
p.plot(Epath, color='black', linestyle=':', linewidth=2.0, alpha=0.8)
p.text(0.37, 10.05, 'Free H$_2$O',fontsize=12, color='black',ha='right', va='bottom', alpha=1.0)
p.text(1.1, 238, 'H$_2$O + Pt',fontsize=12, color='black',ha='right', va='bottom', alpha=1.0)
p.title('H$_2$O disassociation')
p.ylabel('Energy [eV]')
p.xlabel('Reaction path')
#p.xlim([-0.5, 2.5])
#p.ylim([-0.5, 1.5])
sp.get_xaxis().set_ticks([]) # Turn off ticks on xaxis
#p.savefig('Teste.png')
p.show()
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T16:26:34+00:00Added an answer on May 28, 2026 at 4:26 pm

    You can plot a regular cubic spline version of your data by just doing something like this:

    plot(np.linspace(0,3),spline([0,1,2,3],Epath,np.linspace(0,3)))
    

    which will yield something like:

    enter image description here

    But I suspect that isn’t what you want. You might need to resort to something like Monotone splines or shape preserving splines to get the shape which looks the same as those curves shown in your Wikipedia link. I don’t believe either of those interpolation methods are presently implemented in scipy.

    If you have a rough idea of the mathematical form of those curves, you could always fit your own approximate function for the continuous section and just clamp the function outside of that range. For example:

    plot(np.linspace(0,3),np.maximum(E_react,spline([0,1,2,3],Epath,np.linspace(0,3))))
    

    would yield:

    enter image description here

    which at least “looks” like the curve you linked to, even if it isn’t the correct fit.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to remove some edges from a graph generated using Boost graph
I would like to generate a patch with all commits from a local branch.
I would like to generate the mysql-password hash from js. I know the method
I am creating a function that I would like to generate random strings from
I would like to generate a dynamic image from a script, and then have
I would like to get the photo urls from the from this album: https://graph.facebook.com/175758929145317/photos
I would like to generate POJO, XML for a given database. Database: ( contents
i would like to generate a very simple report with some images and text
I would like to generate a short, unique ID without having to check for
I would like to generate a graphical sitemap for my website. There are two

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.