r/learnpython • u/Joltik2007 • 2h ago
Any advice for plotting an Atomic orbital energy diagram?
The subreddit doesn't let me attach an image so this is a vague rendition of what it looks like.
My current idea is using horizontal bar charts with matplotlib.pyplot, but it doesn't have an x-axis and I'm struggling to create the y axis.
3
Upvotes
2
u/michUP33 1h ago
https://docs.pyvista.org/examples/99-advanced/atomic_orbitals.html
Google found this
1
u/hiriel 1h ago
Maybe a bit more complicated example than you need but here: https://anyplot.ai/energy-level-atomic/python/matplotlib The important bit is plotting the horizontal lines as straight lines between two points with the same y coords, and show only the y axis.
•
u/FontanJanneice18 57m ago
are you trying to generate these dynamically from calculated values, or just making a few static figures for a paper? If its static, drawing raw line segments and text annotations on a blank canvas is much less painful than forcing a chart type to fit.