0

I have two lists in Python and they look like this

lst1 = ['T', 'A', 'T', 'G', 'C', 'A', 'T', 'G', 'C', 'C', 'G', 'T', 'A']

lst2 = [0, 0, 0, 0, 0, 2, 2, 2, 1, 2, 1, 0, 0]

It's a nucleotide sequence, so the first A is obviously different from the next. By simply using

plt.plot(lst1, lst2)
plt.show()

The repeating characters on the X axis is being combined into just the 4 distinct ones. Is there any way I can plot against such a sequence of characters with repetitions?

2
  • How should the combined values in lst2 be handled? For each listing of values in lst2 corresponding to a character in list1, should the values be summed? Commented Mar 6, 2018 at 17:32
  • 1
    Please read and follow the posting guidelines in the help documentation. Minimal, complete, verifiable example applies here. We cannot effectively help you until you post your MCVE code and accurately describe the problem. We should be able to paste your posted code into a text file and reproduce the problem you described. In particular, it's not clear what output you expect. If you want to get the sequence in its given order, then your x-axis values need to be that ordering (i.e. [1, 2, 3, 4, 5, ...] This leaves you with two lists to plot ... ? Commented Mar 6, 2018 at 17:32

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.