我正在努力繪製我擁有的數據框的線圖。數據幀由200列和大約4900行組成。 我的數據幀的這頭看起來如下,使用matplotlib繪製200列數據框的線圖
Geneid pool16.1 pool18.13 pool14.11 pool15.6 pool15.2 pool17.1 pool14.16 pool14.9 pool15.10 ... pool3.13 pool2.3 pool4.7 pool1.16 pool3.14 pool1.14 pool2.14 pool8.7 pool9.15 pool10.11
0 ABL1.exon1 1073 594 901 1164 1117 1681 1516 914 1002
... 1471 1086 1032 1600 1023 1203 1465 546 650 947
1 ABL1.exon2 974 549 738 1006 1057 1463 1463 783 1334 ... 1288 1095 967 1474 881 1134 1326 595 505 912
2 ABL1.exon3 701 619 471 748 732 1043 1145 531 935 ... 1031 871 702 1206 771 985 1236 301 301 710
3 ABL1.exon4 555 225 371 586 559 842 830 402 636 ... 831 621 555 887 575 726 936 359 238 556
4 ABL1.exon5 1063 524 817 1085 1086 1624 1448 843 1368 ... 1523 1234 1185 1883 1025 1387 1655 732 581 882
5 rows × 199 columns
,所以我想繪製從上面的數據幀的折線圖,這裏是我試過,當數據幀的一小部分被用來繪製,
import pandas as pd
import matplotlib.pyplot as plt
%matplotlib inline
plt.style.use('ggplot')
CDKN2A= All_pools[All_pools.Geneid.str.contains("CDKN2A") == True]
CDKN2A.plot.line(figsize=(15,10),x='Geneid',y='value')
其中給出的情節看起來像這樣,
在哪裏我不知道對XA第一列信息xis和和情節沒有資料。我旨在繪製的東西,看起來像這樣,
不過的情節看起來很擰沒有太多信息...任何建議,使它看起來更好將是偉大的..
哇!你是否設法用'.plot()'調用產生這樣一個數字?那麼我沒有數據,所以我不知道發生了什麼,但它看起來很奇怪。無論如何,「任何建議,使其看起來更好」太廣泛。我仍然覺得你不喜歡你的數據,所以可能會得到更好的數據? – Goyo