This is a test version of Biostars. For the public version, visit https://www.biostars.org.
(Python) How to make a plot with repeating values on X axis?

Hi! I am new in programming and would be really happy if you help me.

As a result of previous code I have two lists. How can I make a plot with letters from "lab" (one by one) on the X axis, and corresponding numbers from list "val" - on the Y axis? If I write

lab = ['a', 'b', 'c', 'b', 'a']
val = [1, 2, 3, 2, 1]

from matplotlib import pyplot as plt
plt.bar(lab, val)

It plots each letter on the X axis only once.

Thank you in advance!!

sequence

Then the post can be removed. Sorry, I don't know how to do that)

Hello fiskur!

We believe that this post does not fit the main topic of this site.

Pure programming, not strictly bioinformatics, try Stack Overflow

For this reason we have closed your question. This allows us to keep the site focused on the topics that the community can help with.

If you disagree please tell us why in a reply below, we'll be happy to talk about it.

Cheers!

0 answers

No answers yet.

Log in to answer this question.