Hello, i’ve been struggling to understand the logic behind this concept (hope i’m not the only one here) as I like to understand how the code works and not so much to remember or copy-paste the formula.

I tried to simplify the code hoping it could help me understand how it works and I think I’ve got it now. I will post it here hoping someone can give me feedback to check if i’m doing something wrong (and if i’m right to help those that struggle to understand like I did):

```
store1_x = [X*2 for X in range(6)]
plt.bar(store1_x, sales1)
# Here's the basic formula for the first set of bars (blue ones).
# As I understand, you want a list from 0 to 5 ( range(6) ) because you need to plot 6 blue bars.
# X is every element of that list, and it's being multiplied by 2 to separate the blue bars between each other to make room for the orange bars.
store2_x = [X*2 + 1 for X in range(6)]
plt.bar(store2_x, sales2)
# This is the code for the orange bars, it's the same as above, but adding 1.
# This places the orange bar one space to the right of the preceding blue bar.
# In the exercise this was originally 0.8, which places the blue and orange bars next to each other.
# A width of 0.8 is actually better to understand the data, but I changed it as it helped me to visualize how the code works.
```

So basically you’re creating two lists of positions:

[0, 2, 4, 6, 8, 10]

for the blue bars

and

[0+1, 2+1, 4+1, 6+1, 8+1, 10+1]

or

[1, 3, 5, 7, 9, 11]

for the orange bars

**NOTE:** I know this code positions the ticks in the X axis differently than the initial code, but I think this doesn’t matter when you’re working with string type labels (such as ‘months’, or in this case ‘drinks’) (?)

I hope someone can tell me if i’m understanding this correctly and help others that like to understand how their code works.

Cheers!