# Error in plotting the graph

**URL:** <https://discourse.julialang.org/t/error-in-plotting-the-graph/58548>\
**Category:** New to Julia\
**Created:** [April 4, 2021, 6:38am UTC](https://discourse.julialang.org/t/error-in-plotting-the-graph/58548 "2021-04-04T06:38:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manisha\_07](https://avatars.discourse-cdn.com/v4/letter/m/57b2e6/32.png) [@Manisha\_07](https://discourse.julialang.org/u/Manisha_07)\
**Post date:** [April 4, 2021, 6:38am UTC](https://discourse.julialang.org/t/error-in-plotting-the-graph/58548/1 "2021-04-04T06:38:46Z")

</div>

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(x_cos(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

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [April 4, 2021, 6:54am UTC](https://discourse.julialang.org/t/error-in-plotting-the-graph/58548/2 "2021-04-04T06:54:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [April 4, 2021, 8:13am UTC](https://discourse.julialang.org/t/error-in-plotting-the-graph/58548/3 "2021-04-04T08:13:36Z")

</div>

Please follow the recommended [guidelines](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757) to post your code

---

<div class="post-metadata">

**Author:** ![FPGro](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fpgro/32/20822_2.png) [@FPGro](https://discourse.julialang.org/u/FPGro)\
**Post date:** [April 4, 2021, 8:11pm UTC](https://discourse.julialang.org/t/error-in-plotting-the-graph/58548/4 "2021-04-04T20:11:45Z")

</div>

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:

```julia
Some very
Long code 
Here

```

In terms of the original question:

> [@Manisha\_07](#):
>
> plot!(x,y, scatter(x, y, label=“Sampled Points”, xlims=(lower\_bound, upper\_bound), legend=:top))

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.
