Forums

Python with pylab equal spaced horizontal

Hey,

I'm working on a program that basically goes through a specific number and computes an energy for each number. This energy is just a number.

What I'm trying to do is plot the energies as horizontal lines. The y-axis is energy then the energy is plotted horizontally of 1 unit.

Long story short, im trying to program it so if there is any iteration with an energy equal to any other with the same energy, plot them equally spaced on the same y value. It has to be arbitrary.

Please help!

This sounds like a general Python question rather than a PythonAnywhere-specific one. Perhaps Stack Overflow would be a good place to ask?

It looks like what you want to do is a swarmplot. There are several examples of implementations in stackoverflow, if you don't want to implement it seaborn does have a swarmplot option.