Georgery
Georgery

Reputation: 8117

Size and Colour in Julia Scatter Plot

I want create a scatter plot. I have point size and colour in additional variables (vectors).

x = Float64.(1:10)
y = Float64.(1:10)
c = Float64.(1:10)
s = Float64.(1:10)

scatter(x,y)

I've been googling very long now and could not find the right answer. What I am looking for is this:

enter image description here

Upvotes: 2

Views: 8568

Answers (1)

DNF
DNF

Reputation: 12654

This should get you part of the way there:

x = 1.0:10.0
y = 1.0:10.0
c = 1.0:10.0
s = 1.0:10.0

theme(:ggplot2)
scatter(x, y; zcolor=c, markersize=s, color=:oslo)

I didn't have time to try to figure out the legends.

enter image description here

There are a nearly unlimited number of colorschemes, have a look here if this one isn't exactly right: https://docs.juliaplots.org/latest/generated/colorschemes/

Upvotes: 6

Related Questions