Home > Net >  Plot y axis shows strange values
Plot y axis shows strange values

Time:12-20

Would anyone tell me why the y axix didn't show 0 and 8? I appreciate your help! enter image description here

import pandas as pd
import numpy as np
import matplotlib.pyplot as pylot
from matplotlib import style
from sklearn.utils import shuffle
data = pd.read_csv("data.csv")
data.dropna()
data = data.dropna()
data  =  data.reset_index(drop=True)
style.use("ggplot")
p = "gene_A"
pylot.scatter(data[p], data["phenotype"])
pylot.xlabel(p)
pylot.ylabel("phenotype")
pylot.show()

enter image description here

CodePudding user response:

It's working fine for me. The most likely error is if you have formatting issues for datatype. Try running

data['phenotype'] = data['phenotype'].astype(float)

enter image description here

  • Related