Home > Community > Creating energy profile diagrams for publication
Upvote

29

Downvote
+ Software
Posted by
Mohamed Abdelaleem

Creating energy profile diagrams for publication

Charles Foy  Follow

PyEnergyDiagrams

I use my own script. I have posted it on GitHub now.This is the final result:enter image description here

It is quite easy to use, on the GitHub readme there is a small tutorial. You have to create an instance of ED class and then add the energy levels to it.

from energydiagram import EDdiagram = ED()diagram.add_level(0,'Separated Reactants')diagram.add_level(-5.4,'mlC1')diagram.add_level(-15.6,'mlC2','last',)diagram.add_level(28.5,'mTS1',color='g')diagram.add_level(-9.7,'mCARB1')diagram.add_level(-19.8,'mCARB2','last')diagram.add_level(20,'mCARBX','last')

To add the links between the levels you can have a look to the IDs of the level using this the argument of the function plot show_IDs=True:

diagram.plot(show_IDs=True)

enter image description here

And then you can use:

 diagram.add_link(left_ID_levetobelinked,right_ID_levetobelinked)

Export to pgf,pdf and svg

You can export it just saving the plot from the GUI button or programmatically in different formats for publications using matplotlib backend. I prefer to export the plot in .pgf and then I import it in the LaTeX document this allow a full control over fonts and appearance of the figure.

enter image description here

For reaching better quality you have to change a little bit the autogenerated .pgf file.

The first thing you have to do is to find and replace − with -.

Later you can follow the procedure in this answer so that the font of the figure matches with the font size and type of the document.

More

Upvote

VOTE

Downvote
Jason Green  Follow
@Martin-マーチン nope that one is another kind of pgf. I am referring to More
Upvote

VOTE

Downvote
Jessica Taylor  Follow
I have no experience with pgf, and from Wikipedia I get that it is a bitmap file format. While I dont use LaTeX much anymore, I dont see how a bitmap would be superior to a vector image. But maybe this isnt the right place to discuss this. But I will certainly look into your script.More
Upvote

VOTE

Downvote
Erii Mascar  Follow
en.wikipedia.org/wiki/PGF/TikZMore
Upvote

VOTE

Downvote
John Miller  Follow
@Martin-マーチン Yes, you can its very easy. But if you use latex I would suggest to use pgf so you can modify your figure later on.More
Upvote

VOTE

Downvote
Douglas Bush  Follow
Wow, that looks cool! Is it possible to export the image to svg or pdf, too?More
Upvote

VOTE

Downvote