# How to find the arguments of a function in a package

**URL:** <https://discourse.julialang.org/t/how-to-find-the-arguments-of-a-function-in-a-package/58219>\
**Category:** New to Julia\
**Tags:** package\
**Created:** [March 30, 2021, 11:51am UTC](https://discourse.julialang.org/t/how-to-find-the-arguments-of-a-function-in-a-package/58219 "2021-03-30T11:51:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sbacelar](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sbacelar/32/4359_2.png) [@sbacelar](https://discourse.julialang.org/u/sbacelar)\
**Post date:** [March 30, 2021, 11:51am UTC](https://discourse.julialang.org/t/how-to-find-the-arguments-of-a-function-in-a-package/58219/1 "2021-03-30T11:51:34Z")

</div>

I want to use the function `scatter`. I know that this function belongs to the package `Plots` or `StatsPlots`. I am not sure.

1. How do I know the package where `scatter` is defined?
2. How to find the arguments of `scatter`?
3. Is it possible to find help about `scatter` in the REPL? How?  
Maybe I have a problem reading the documentation of some packages in `Julia`. I think that in `R` package documentation is more standardized but perhaps I am wrong.

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [March 30, 2021, 12:32pm UTC](https://discourse.julialang.org/t/how-to-find-the-arguments-of-a-function-in-a-package/58219/2 "2021-03-30T12:32:50Z")

</div>

> [@](#):
>
> - How do I know the package where `scatter` is defined?

`methods` tells you, but only if you already using the package which defines it:

```julia
julia> using Plots

julia> using StatsPlots

julia> methods(scatter)
# 1 method for generic function "scatter":
[1] scatter(args...; kw...) in Plots at C:\Users\oheil\.julia\packages\RecipesBase\92zOw\src\RecipesBase.jl:403

```

If you search for a function without knowing anything about it Julia can’t help in general.

> [@](#):
>
> - How to find the arguments of `scatter` ?

First check is always ? in the REPL:

```julia
help?> scatter
search: scatter scatter! scatter3d scatter3d! scatterhist scatterhist! marginalscatter marginalscatter! AbstractPattern

  scatter(x,y)
  scatter!(x,y)

  Make a scatter plot of y vs x.

  Examples
  ≡≡≡≡≡≡≡≡≡≡

  julia> scatter([1,2,3],[4,5,6],markersize=[3,4,5],markercolor=[:red,:green,:blue])
  julia> scatter([(1,4),(2,5),(3,6)])

```

Second check the documentation, if available, in this case [Home · Plots](https://docs.juliaplots.org/latest/)  
Third and Fourth, depending on your preferences:  
Ask here or check the source code.

> [@](#):
>
> - Is it possible to find help about `scatter` in the REPL? How?

As said above using ? in the REPL (but it needs to be loaded with `using`)

> [@](#):
>
> Maybe I have a problem reading the documentation of some packages in `Julia` . I think that in `R` package documentation is more standardized but perhaps I am wrong.

I think you are right. The Vignette system (at least for the bioconductor project) is quite standardized and nearly always at hand. But it isn’t therefore better. It’s more like: lets have the lowest possible requirement as a standard  
In R if you just have a function name and nothing else you are lost like in Julia or in every other language where a package ecosystem exists.  
With some exceptions I find the documentation of Julia and many packages outstanding, despite that you have to search for it and several presentations exist.

A last hint: asking here is always beneficial and perhaps the fastest way to good results, but, of course, you need to ask in a minimal specific way 🙂

---

<div class="post-metadata">

**Author:** ![rikh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rikh/32/204104_2.png) [@rikh](https://discourse.julialang.org/u/rikh)\
**Post date:** [March 31, 2021, 9:13pm UTC](https://discourse.julialang.org/t/how-to-find-the-arguments-of-a-function-in-a-package/58219/3 "2021-03-31T21:13:53Z")

</div>

For the first question, there is also a fun macro which opens the method definition in a text editor. For example,

```julia
@edit round(3.4)

```

Edit: This is just an addition to the previous comment. The edit macro is nice if documentation for a method is missing or when the documentation isn’t very clear.
