#🔒How to remove the 1 from x-axis

8 messages · Page 1 of 1 (latest)

nimble steeple
#

I'm programming a code that gets information for a data set of a lottery that looks like this:

The columns are: ball1, ball2, ball3, ball4, ball5, ball6, number of winners, prize per winner. If there is no winner, the prize rolls over to the next lottery draw.
3 5 14 22 30 44 7 839254
6 12 15 16 31 44 4 1760966
11 17 21 29 30 40 0 0
26 35 38 43 47 49 1 17880003
3 5 9 13 14 38 2 3403310
...

I have to do the following exercise:

A theory suggests that the more consecutive numbers are part of a combination, the less likely it is to win a prize. Analyze the probability of someone winning a prize in relation to the number of consecutive numbers. Represent this relationship in a graph and interpret the data, confirming or refuting the theory.

My code is in the txt file.

Looking in to the image of the graph I sent, the question I have is how can I remove the 1 from the x-axis and the blank space that exists between 0 and 2. I want to remove it because it doesn't make sense saying 1 consecutive number. Either there's 0 consecutive numbers or 2 or more.

How can I fix that

neat islandBOT
#

@nimble steeple

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

neat islandBOT
warm leaf
#

I have no clue why (it's probably explained in the documentation), but for some reason if it's an integer list it appears to just make the whole range...
Anyways: Just do

plt.bar(["0", "2", "3", "4", "5", "6"], probs.values())
```and it works
nimble steeple
warm leaf
#

🐒
You're welcome

neat islandBOT
#
Python help channel closed using Discord native close action

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.