Plot not defined

I was using plots previously. suddenly it stopped working.

julia> using Plots

julia> x = 1:10 ; y = rand(10)
10-element Vector{Float64}:
 0.328078505773031
 0.1228315686010254
 0.18449539206763776
 0.9873483723089912
 ā‹®
 0.730594845410921
 0.10355436599035883
 0.9464562835035604
 0.5769754861870682

julia> plot(x,y)
ERROR: UndefVarError: plot not defined
Stacktrace:
 [1] top-level scope
   @ none:1

these are the current status of my packeges

(@v1.7) pkg> st
      Status `~/.julia/environments/v1.7/Project.toml`
  [cbdf2221] AlgebraOfGraphics v0.6.4
  [c52e3926] Atom v0.12.36
  [336ed68f] CSV v0.10.2
  [13f3f980] CairoMakie v0.7.2
  [8be319e6] Chain v0.4.10
  [a93c6f00] DataFrames v1.3.2
  [1313f7d8] DataFramesMeta v0.10.0
  [28b8d3ca] GR v0.63.1
  [c91e804a] Gadfly v1.3.4
  [7073ff75] IJulia v1.23.2
  [e5e0dc1b] Juno v0.8.4
  [bd3c0b08] MissingsAsFalse v0.1.0
  [3beb2ed1] PDFmerger v0.2.0
  [69de0a69] Parsers v2.2.2
  [91a5bcdd] Plots v1.25.9
  [d330b81b] PyPlot v2.10.0
  [1277b4bf] ShiftedArrays v1.0.0
  [f3b207a7] StatsPlots v0.14.33
  [ade2ca70] Dates

can some one help to resolve this ? thanks.

Is this a fresh Julia section? It may happen that two packages you are using export plot functions, and then you have to qualify the name (there is a warning message about that):

julia> using Plots, GR

julia> x = rand(10);

julia> plot(x)
WARNING: both GR and Plots export "plot"; uses of it in module Main must be qualified
ERROR: UndefVarError: plot not defined
Stacktrace:
 [1] top-level scope
   @ REPL[5]:1

julia> plot(x)
ERROR: UndefVarError: plot not defined
Stacktrace:
 [1] top-level scope
   @ REPL[5]:1

julia> Plots.plot(x) # this works

2 Likes