# How to color points in scatter plot by value?

**URL:** https://discourse.julialang.org/t/how-to-color-points-in-scatter-plot-by-value/11740
**Category:** General Usage
**Tags:** plotting
**Created:** [June 17, 2018, 11:03pm UTC](https://discourse.julialang.org/t/how-to-color-points-in-scatter-plot-by-value/11740 "2018-06-17T23:03:16Z")
**Posts on this page:** 1
**Showing post:** 22

<div class="post-metadata">

### Author: ![alex-s-gardner](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alex-s-gardner/32/30210_2.png) [@alex-s-gardner](https://discourse.julialang.org/u/alex-s-gardner)
#### Post date: [December 19, 2022, 6:05pm UTC](https://discourse.julialang.org/t/how-to-color-points-in-scatter-plot-by-value/11740/22 "2022-12-19T18:05:36Z")

</div>

This can also be done using Makie.jl:

> [@Makie recipe for creating a scatter plot with points colored by value](https://discourse.julialang.org/t/makie-recipe-for-creating-a-scatter-plot-with-points-colored-by-value/91754/5):
>
> This is much easier than I had thought, for anyone that comes next here is the recipe (See Makie docs has a more [generic scatter example](https://docs.makie.org/stable/examples/plotting_functions/scatter/#using_points) and examples for [colored lines](https://beautiful.makie.org/dev/examples/generated/2d/lines/line_cmaps/): using CairoMakie # create synthetic data n = 1000; x = 1:n; y = sin.(collect(x) .\* .05); z = vcat(1:n/2, n/2:-1:1) .- n/4 # set color axis limits which by default is automatically equal to the extrema of the color values colorrange = [-n/4, n/4]; # choose color map [https://docs.juliahub…

---

_[View the full topic](https://discourse.julialang.org/t/how-to-color-points-in-scatter-plot-by-value/11740)._
