简体   繁体   中英

Data not following tick position while being plotted

I'm trying to plot a graph where I can change the position of my tick/labels and the plot actually follow these positions. Right now, it's not happening. What is the proper way to plot this? Basically, I want the plot to follow the tick position.

Thank you

the Data:

    MAG   variable          value
0    ZC4RG01  DAY01_tpm  436560.520594
1    ZC4RG02  DAY01_tpm  478950.594993
2    ZC4RG03  DAY01_tpm   64427.048996
3    ZC4RG04  DAY01_tpm  169800.918347
4    ZC4RG05  DAY01_tpm   40096.842341
5    ZC4RG06  DAY01_tpm   84662.286917
...

This is the piece of code that I have

melted_df = TPM_df.melt(id_vars='MAG')

g = sns.FacetGrid(melted_df, col='MAG', col_wrap= 2,height=4)

g.map(sns.pointplot, "variable", "value", color=".3", ci=None)
g.set(xlabel='', ylabel='TPM')
g.set(xticks=[1,3,7,15,30,64,67,78,99],xticklabels=['DAY01','DAY03','DAY07','DAY15','DAY30','DAY64','DAY67','DAY78','DAY99'])
g.set_titles(col_template = '{col_name}')

This is what I have right now

图表

What I want

图表

Ok.. I kept trying this for my own and I found the solution... First I created a column within the position on the graph (as commented before). After that I used this POS as X axis while ploting. The secret, in this case, was to use seaborn.lineplot instead of seaborn.pointplot. It took me days to solve this, but now it's working. Ty for who tried to help and not judge :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM