16
$\begingroup$

Is there automated software to create energy profile diagrams like the ones below?

One could use something like Illustrator or Inkscape, but they aren't automated, are expensive (Illustrator), are difficult to use, and wouldn't be practical for anything with more than a dozen energy levels. These diagrams don't look like they were hand-drawn, but I could be mistaken.

Ideally, it would be written in Python, but something in LaTeX or TikZ would be workable as well.

More specifically, I think this could be improved upon quite a bit.

$\endgroup$
  • 1
    $\begingroup$ I think I recall from some chat session, that LordStryker was working on something like that, but it was in its early stages and I am not aware that he has published/released it. Other than that I have not yet come across something like that. I know that my coworkers draw them in Illustrator, I prefer inkscape. I guess one could cook up a solution in gnuplot, which is iirc able to produce various output formats. I personally prefer tables though and if really necessary dot-line diagrams. Still +1. $\endgroup$ – Martin - マーチン Jan 9 '16 at 18:50
  • $\begingroup$ I've done a very crude one by hand in gnuplot before when attempting to make an MO diagram, but I was hoping for something more "automated" than that (though I would still prefer it to Inkscape, which I want to avoid learning). Anything similar I've just done in Keynote, which leaves me too reliant on a Mac. $\endgroup$ – pentavalentcarbon Jan 9 '16 at 20:16
  • 4
    $\begingroup$ I just found something in my link section that looks promising. Let me know if it helped. Nice Energy Level Diagrams with rxnlvl - wp.me/ptBY1-2W $\endgroup$ – Martin - マーチン Jan 24 '16 at 14:19
  • $\begingroup$ If this isn't exactly what I was looking for, then I could definitely modify it to suit my own usage. Looks great, thanks! $\endgroup$ – pentavalentcarbon Jan 26 '16 at 21:20
  • 1
    $\begingroup$ Did you come up with something suitable and easy to use? $\endgroup$ – Martin - マーチン Sep 5 '16 at 8:04
16
$\begingroup$

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 ED
diagram = 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.

$\endgroup$
  • 4
    $\begingroup$ Wow, that looks cool! Is it possible to export the image to svg or pdf, too? $\endgroup$ – Martin - マーチン Jan 24 '17 at 9:31
  • $\begingroup$ @Martin-マーチン Yes, you can it's very easy. But if you use latex I would suggest to use pgf so you can modify your figure later on. $\endgroup$ – G M Jan 24 '17 at 13:36
  • $\begingroup$ I have no experience with pgf, and from Wikipedia I get that it is a bitmap file format. While I don't use LaTeX much anymore, I don't see how a bitmap would be superior to a vector image. But maybe this isn't the right place to discuss this. But I will certainly look into your script. $\endgroup$ – Martin - マーチン Jan 24 '17 at 13:46
  • $\begingroup$ @Martin-マーチン nope that one is another kind of pgf. I am referring to en.wikipedia.org/wiki/PGF/TikZ $\endgroup$ – G M Jan 24 '17 at 14:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.