# Change the values in colorbar to cover all values

**URL:** https://discourse.julialang.org/t/change-the-values-in-colorbar-to-cover-all-values/107603
**Category:** New to Julia
**Tags:** plotting, pyplot
**Created:** [December 14, 2023, 9:07am UTC](https://discourse.julialang.org/t/change-the-values-in-colorbar-to-cover-all-values/107603 "2023-12-14T09:07:40Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![quantum](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/quantum/32/48798_2.png) [@quantum](https://discourse.julialang.org/u/quantum)
#### Post date: [December 14, 2023, 9:07am UTC](https://discourse.julialang.org/t/change-the-values-in-colorbar-to-cover-all-values/107603/1 "2023-12-14T09:07:40Z")

</div>

I am new to python and Julia. I want add a color bar to a scatter plot. But the values of colorbar just cover one group of points. How can I change the color bar to cover all the values? My code attached.

```julia
fig, ax = PyPlot.subplots()
n=100
x1 = rand(5:0.1:10, n)
x2 = rand(1:0.1:4, n)

y1 = rand(1:0.1:4, n)
y2 = rand(5:0.1:10, n)

cb1 = rand(6:0.1:10, n)
cb2 = rand(1:0.1:4, n)

sca = ax.scatter(x1, y1, marker="s", c=cb1, s=100)
ax.scatter(x2, y2, marker="o", c=cb2, s=100)

fig.colorbar(sca, ax=ax)

gcf()

```

![output](https://global.discourse-cdn.com/julialang/original/3X/b/b/bbb29366b5a41041702d580736e929ca50bbb5e7.png)
