Error in plotting the graph

Hello
I am trying to excecute the program but facing the issue only when i am trying to plot the fucntion,
//my program
n_samples = 15
lower_bound = 0
upper_bound = 14/15
x = sample(n_samples, lower_bound, upper_bound, SobolSample())
f = x->exp(xcos(3(22/7)*x))
y = f.(x)
scatter(x, y, label=“Sampled Points”, xlims=(lower_bound, upper_bound), legend=:top)
plot!(x,y, scatter(x, y, label=“Sampled Points”, xlims=(lower_bound, upper_bound), legend=:top))

//error iam getting
MethodError: no method matching Plots.Plot{Plots.GRBackend}(::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char, ::Char)
Closest candidates are:
Plots.Plot{T}(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) where T<:AbstractBackend at C:\Users\Manisha Gowda.julia\packages\Plots\SVksJ\src\types.jl:68

Stacktrace:
[1] apply_recipe(plotattributes::Dict{Symbol, Any}, #unused#::Type{Plots.Plot{Plots.GRBackend}}, plt::Plots.Plot{Plots.GRBackend})
@ Plots ~.julia\packages\Plots\SVksJ\src\recipes.jl:50
[2] _apply_type_recipe(plotattributes::Any, v::Any, letter::Any)
@ RecipesPipeline ~.julia\packages\RecipesPipeline\CirY4\src\type_recipe.jl:20
[3] macro expansion
@ ~.julia\packages\RecipesPipeline\CirY4\src\user_recipe.jl:126 [inlined]
[4] apply_recipe(plotattributes::AbstractDict{Symbol, Any}, x::Any, y::Any, z::Any)
@ RecipesPipeline ~.julia\packages\RecipesBase\92zOw\src\RecipesBase.jl:282
[5] _process_userrecipes!(plt::Any, plotattributes::Any, args::Any)
@ RecipesPipeline ~.julia\packages\RecipesPipeline\CirY4\src\user_recipe.jl:36
[6] recipe_pipeline!(plt::Any, plotattributes::Any, args::Any)
@ RecipesPipeline ~.julia\packages\RecipesPipeline\CirY4\src\RecipesPipeline.jl:70
[7] _plot!(plt::Plots.Plot, plotattributes::Any, args::Any)
@ Plots ~.julia\packages\Plots\SVksJ\src\plot.jl:172
[8] plot!(::Plots.Plot, ::Any, ::Vararg{Any, N} where N; kw::Any)
@ Plots ~.julia\packages\Plots\SVksJ\src\plot.jl:162
[9] plot!(::Plots.Plot, ::Any, ::Vararg{Any, N} where N)
@ Plots ~.julia\packages\Plots\SVksJ\src\plot.jl:159
[10] plot!(::Any, ::Vararg{Any, N} where N; kw::Any)
@ Plots ~.julia\packages\Plots\SVksJ\src\plot.jl:153
[11] plot!(::Any, ::Any, ::Vararg{Any, N} where N)
@ Plots ~.julia\packages\Plots\SVksJ\src\plot.jl:147
[12] top-level scope
@ In[17]:8
[13] eval
@ .\boot.jl:360 [inlined]
[14] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
@ Base .\loading.jl:1094

Please provide a working example of your code, including any packages you are using

1 Like

Please follow the recommended guidelines to post your code

1 Like

Hello and welcome. First of all, you should provide minimal working examples (you were missing the include/using statements to make it self-contained) and format code properly: to enable proper highlighting, you should enclose code in backticks `.

Single backticks like `Code` will appear as code for inline use. Longer sections should be included in triple backticks:

```julia
Some very
Long code
Here
```

Will appear as:

Some very
Long code 
Here

In terms of the original question:

This line looks odd. There’s a scatter inside a plot, both with x and y provided, although I don’t know if plot does that, it takes lots of things without complaining.