1

When I try to fit a curve with plotnine,it had a error that couldn 't run That's my code

import pandas as pd
import numpy as np
from plotnine import *
import skmisc 
df=pd.read_csv('Scatter_Data.csv')
plot_loess=(ggplot( df, aes('x','y')) +
    geom_point(fill="black",colour="black",size=3,shape='o') +
    geom_smooth(method = 'loess',span=0.4,se=True,colour="#00A5FF",fill="#00A5FF",alpha=0.2)+ #(f)
    scale_y_continuous(breaks = np.arange(0, 126, 25))+
    theme(
        axis_title=element_text(size=18,face="plain",color="black"),
         axis_text = element_text(size=16,face="plain",color="black"),
       legend_position="none",
       aspect_ratio =1,
         figure_size = (5, 5),
         dpi = 100
         )
)

print(plot_loess)

this is the traceback: enter link description here

0 Answers0