# Behavior of kwargs with scatter plot in PyPlot

**URL:** <https://discourse.julialang.org/t/behavior-of-kwargs-with-scatter-plot-in-pyplot/62140>\
**Category:** General Usage\
**Tags:** pyplot\
**Created:** [May 31, 2021, 3:18pm UTC](https://discourse.julialang.org/t/behavior-of-kwargs-with-scatter-plot-in-pyplot/62140 "2021-05-31T15:18:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![josimar](https://avatars.discourse-cdn.com/v4/letter/j/cab0a1/32.png) [@josimar](https://discourse.julialang.org/u/josimar)\
**Post date:** [May 31, 2021, 3:18pm UTC](https://discourse.julialang.org/t/behavior-of-kwargs-with-scatter-plot-in-pyplot/62140/1 "2021-05-31T15:18:46Z")

</div>

I am looking to understand how to pass kwargs to scatter plot using PyPlot.

My version control:

```julia
(@v1.5) pkg> st
Status `~/.julia/environments/v1.5/Project.toml`
  [c52e3926] Atom v0.12.30
  [e5e0dc1b] Juno v0.8.4
  [d330b81b] PyPlot v2.9.0
  [295af30f] Revise v3.1.14
  [44cfe95a] Pkg
  [10745b16] Statistics

```

This illustrates the error that I am getting:

```julia
using PyPlot
pygui(true)

## I want to set the size equal to 50 
kwargs=Dict(:s => 50)

## This works fine
figure("Plot_1")
clf()
ax=gca()
ax.scatter(1:10,1:10, s=50)

## This also works
figure("Plot_2")
clf()
ax=gca()
ax.plot(1:10,1:10, kwargs...)

## This does not work, why? 
figure("Plot_3")
clf()
ax=gca()
ax.scatter(1:10,1:10, kwargs...)

```

The error message that I get for Plot\_3 above is:

```julia
ERROR: LoadError: PyError ($(Expr(:escape, :(ccall(#= /home/josimar/.julia/packages/PyCall/BD546/src/pyfncall.jl:43 =# @pysym(:PyObject_Call), PyPtr, (PyPtr, PyPtr, PyPtr), o, pyargsptr, kw))))) <class 'ValueError'>
ValueError('s must be a scalar, or the same size as x and y')
  File "/home/josimar/.julia/conda/3/lib/python3.8/site-packages/matplotlib/ __init__.py", line 1447, in inner
    return func(ax, *map(sanitize_sequence, args), **kwargs)
  File "/home/josimar/.julia/conda/3/lib/python3.8/site-packages/matplotlib/cbook/deprecation.py", line 411, in wrapper
    return func(*inner_args, **inner_kwargs)
  File "/home/josimar/.julia/conda/3/lib/python3.8/site-packages/matplotlib/axes/_axes.py", line 4448, in scatter
    raise ValueError("s must be a scalar, or the same size as x and y")

```

Let me know if anyone knows how to pass kwargs to scatter plot.
