# Plot an energy level diagram

I have the following list:

gs = {-0.4993484712, -0.4978548043,
-0.4940563241, -0.4836338315,
-0.4559910524, -0.3817524976,
-0.1667542598, -0.1206998794,
-0.1192191910, -0.1152026146,
-0.1046546835, -0.0769508374,
-0.0026840318};


I want to draw a plot using my list as The one in the picture below. How can I do so?

Plot[gs, {x, .2, 1},
PlotStyle -> Black,
Axes -> {False, True},
AspectRatio -> 2,
PlotRange -> {{0, 1}, Automatic}]


Alternatively, you can process gs to get the coordinates for 13 lines and use those coordinates with Graphics:

linecoords = {{0.05, #}, {.25, #}} & /@ gs;

Graphics[{Line /@ linecoords},
Axes -> {False, True},
PlotRange -> {{0, .25}, All}]


• great! Thanks a lot Jun 11, 2020 at 9:20
• @Wisdom, you are welcome.
– kglr
Jun 11, 2020 at 9:21
• Dear @kglr can you tell me what part of your code produces the horizontal lines? Jun 11, 2020 at 9:24
• @Wisdom, as you can see from the simpler example Plot[{2, 5, x^2}, {x, 0, 2}] we are using gs as 13 different constant functions.
– kglr
Jun 11, 2020 at 9:31
• OK got it. Thanks again Jun 11, 2020 at 9:44