# Add single point to plot using Plots pyplot()

**URL:** <https://discourse.julialang.org/t/add-single-point-to-plot-using-plots-pyplot/31886>\
**Category:** General Usage\
**Created:** [December 5, 2019, 3:44am UTC](https://discourse.julialang.org/t/add-single-point-to-plot-using-plots-pyplot/31886 "2019-12-05T03:44:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![juliauser](https://avatars.discourse-cdn.com/v4/letter/j/46a35a/32.png) [@juliauser](https://discourse.julialang.org/u/juliauser)\
**Post date:** [December 5, 2019, 3:44am UTC](https://discourse.julialang.org/t/add-single-point-to-plot-using-plots-pyplot/31886/1 "2019-12-05T03:44:47Z")

</div>

Hi,

I would like to add a point to a graph, like a heatmap.

It works fine if I do

```julia
plot!([1.],[1.],color="blue")

```

but if use

```julia
plot!([a.],[a.],color="blue")

```

where a is a variable Int64, I get the error unexpected ]. Removing ] does not change anything

---

<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:** [December 5, 2019, 7:17am UTC](https://discourse.julialang.org/t/add-single-point-to-plot-using-plots-pyplot/31886/2 "2019-12-05T07:17:01Z")

</div>

Your issue is not really a plotting issue but a parsing issue. For legal numbers, the parser interprets a dot as shorthand for `.0`, but this doesn’t work for variables, where it is interpreted as field access (as in `myobj.field`)

Consider:

```julia
julia> 1.
1.0

julia> a = 1
1

julia> [a.]
ERROR: syntax: unexpected "]"

julia> [a]
1-element Array{Int64,1}:
 1

```

So try removing the dot in your code. For plotting points also consider using `scatter` instead of `plot`

---

<div class="post-metadata">

**Author:** ![juliauser](https://avatars.discourse-cdn.com/v4/letter/j/46a35a/32.png) [@juliauser](https://discourse.julialang.org/u/juliauser)\
**Post date:** [December 5, 2019, 12:57pm UTC](https://discourse.julialang.org/t/add-single-point-to-plot-using-plots-pyplot/31886/3 "2019-12-05T12:57:04Z")

</div>

Very clear, it works now. Thanks.
