r/comp_chem • • Apr 10 '26

A Python package for conveniently creating reaction energy diagrams (reaction level diagrams)

Creating reaction energy diagrams with Matplotlib or other software manually is usually very time-consuming. Therefore, I created a Python package which can handle path drawing, numbering and layout automatically and has other useful features like image insertion or difference bars. It also features multiple drawing styles. Since it is based on Matplotlib, it remains fully customizable while still speeding up diagram construction significantly.

A minimal working example could look like this:

dia = EnergyDiagram() 
dia.draw_path(x_data=[0, 1, 2, 3], y_data=[0, -13, 75, 20], color="blue") 
dia.add_numbers_auto()
dia.set_xlabels(["Reactant", "IM", "TS", "Product"]) 
dia.show()

The package is available on PyPi and can be installed with pip:

pip install chemdiagrams

You can find the links to the project here:
GitHub: https://github.com/Tonner-Zech-Group/chem-diagrams
PyPi: https://pypi.org/project/chemdiagrams/
Documentation: https://tonner-zech-group.github.io/chem-diagrams/

I would love to get any feedback!

61 Upvotes

4 comments sorted by

8

u/Spiritual_Fisherman Apr 10 '26

There was a post about this a while ago which has some other alternatives if people were not aware of them. Might be worth looking at for some inspiration or to see if you are missing anything. https://www.reddit.com/r/comp_chem/s/hZQM0v6Zum

2

u/Illustrious_Egg_3141 Apr 10 '26

Thanks for the hint. The answers in the Subreddit actually mostly suggest manual plotting and I actually have not found any other flexible Python package out there, although some with limited functionality (PyEnergyDiagrams maybe is the next best thing, but it actually does not really seem to be too flexible or convinient either to me, but could be wrong).

I've tried to think of everything possible that could be needed for a reaction energy plotting software usable for producing publication quality. The main thing still missing is the possibility to put images above the plot (in the plot is possible though). Although this is mostly done manually anyway.

7

u/Formal-Spinach-9626 Apr 10 '26

I've spent too much time making those diagrams. I haven't tried it, but thank you for making this.

4

u/Piperitone Apr 10 '26

Great and handy contribution to the comp-chem community