0

I have two lists, one corresponds to x values and another corresponds to y values. So you can reproduce it, the lists are x = [1, 10, 50, 100, 250, 500, 750, 900, 950, 1000, 1500, 2000, 3500, 5000, 6500, 8000, 9000, 1000, 11000, 12000, 14000]

and y = [0.8980629181861878, 0.10853165966272355, 0.08126119875907897, 0.06252053439617157, 0.06377455067634583, 0.06653642201423646, 0.059822401523590085, 0.062289491295814514, 0.05231357836723328, 0.05339253479242325, 0.05086378312110901, 0.05312803852558136, 0.059300369888544084, 0.05587265187501907, 0.06438382065296173, 0.059782819837331774, 0.08129128956794739, 0.05339253479242325, 0.08861093366146088, 0.0757862297296524, 0.10072390681505203]

When I write

plt.plot(x, y, marker='D')
plt.xlabel("x")
plt.ylabel("y")
plt.show()

It outputs this image enter image description here

This is strange as I expect each diamond to be connected to only one other diamond, the one adjacent to him from the right as we look on x axis.

What am I doing wrong?

1
  • 2
    change the 1000 after 9000 to 10000 ? Commented Oct 19, 2020 at 11:11

1 Answer 1

3

Your input is formatted wrong, x contains 1000 after 9000, it should be 10000. Pyplot plotted your values correctly.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.