PyError Occurs When Drawing Graphs Using StatsPlots in Julia

Asked 1 years ago, Updated 1 years ago, 90 views

I tried to draw a graph using StatsPlots in Julia and wrote the following code:

using StatsPlots
@ df dfplot(:x axis,:y axis)
    , title="Title"
    , xlabel = "x-axis"
    ,ylabel="y-axis")

Already df has csv data

df=CSV.read(loc*filename,DataFrame,header=true,delim=",")

It is read as .
However, I received the following error:

PyError($(Expr(:escape, :(ccall(#=C:\Users\My Name\.julia\packages\PyCall\BD546\src\pyfncall.jl:43=#@pysym(:PyObject_Call), PyPyPtr, (PyPyPyPyPtr,PyTr,Pytr,Pytr'),));pytr'), pytr'), pytr'), ply)&py)&pytr'), ply)
AttributeError("'Line2D'object has no property'title')

By the way, it worked fine when I described it as below.

using StatsPlots
@ df df plot (:x axis, :y axis)

Can someone help me with how to resolve this error?

julia

2022-09-30 19:55

1 Answers

I think it's a typo.

@df dfplot(:x axis,:y axis)

Changing the :y-axis to :y-axis should work.

I don't know the contents of the file, but if @dfdfplot(:x axis,:y axis) works, I think the y axis is correct, not the y axis.


2022-09-30 19:55

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.