This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Why python eventplot shows different color compared with the color I choose?

Python eventplot shows that:

colors

must be a sequence of RGBA tuples (eg arbitrary color

strings, etc, not allowed) or a list of such sequences

I want to show driver gene,sex information and clinic stage in one picture to make it more visual with python matplotlib eventplot.I use RGBA tuples for both picture and legend,but it shows different colors between main picture and legend.

for example:

clinic:

if len(a1) > 0:
clinic_data.append(a1)
clinic_lineoffset.append(0.5)
clinic_corlor.append((0.8,0.8,0.8))

if len(b1) > 0:
clinic_data.append(b1)
clinic_lineoffset.append(0.5)
clinic_corlor.append((0.6,0.6,0.6))

if len(c1) > 0:
clinic_data.append(c1)
clinic_lineoffset.append(0.5)
clinic_corlor.append((0.4,0.4,0.4))

if len(d1) > 0:
clinic_data.append(d1)
clinic_lineoffset.append(0.5)
clinic_corlor.append((0.0,0.0,0.0))

add legend for clinic:

axHistx0.scatter(1.5,0,c=(0.8, 0.8, 0.8),marker='s',linewidths=0,s=100)
axHistx0.text(3,0,'Stage 1',fontsize=10)
axHistx0.scatter(10,0,c=(0.6, 0.6, 0.6),marker='s',linewidths=0,s=100)
axHistx0.text(11.5,0,'Stage 2',fontsize=10)
axHistx0.scatter(18.5,0,c=(0.4, 0.4, 0.4),marker='s',linewidths=0,s=100)
axHistx0.text(20,0,'Stage 3',fontsize=10)
axHistx0.scatter(27,0,c=(0.0, 0.0, 0.0),marker='s',linewidths=0,s=100)
axHistx0.text(28.5,0,'Stage 4',fontsize=10)
python eventplot

This is not related to bioinformatics, if you want to keep this question open, please post a reproducible example from a biological context demonstrating the use of the library using data of clear biological origin. Otherwise the question will be closed.

0 answers

No answers yet.

Log in to answer this question.