Am 10.10.2018 um 12:16 schrieb Artur T.:
Am 10.10.2018 um 12:04 schrieb Riccardo (Jack) Lucchetti:
>
> Gnuplot 5.2 has introduced the "set jitter" command, which I think
> could be quite nice to incorporate in our plot/gnuplot command combo.
> Just to show you what the "jitter" thing is about, I prepared a little
> script, where we plot log wage versus educational level from the Mroz
> dataset:
Very nice, I wasn't aware of it.
Comment the "square" option, and you even get a nice swarm-plot.
<hansl>
plot X
option fit=none
literal set jitter spread 0.1 #square
end plot --output=display
</hansl>
> I was thinking we could have a --jitter option (possibly with
> parameters) to the gnuplot command; I would even think it could be a
> good idea to have this on by default is the x-axis series is discrete.
> OTOH, one may argue that the same effects is achieved quite easily via
> a literal, as in my previous example, and the gnuplot commmand is
> already loaded with lots of options and we don't need a new one.
I am in favor of the literal-type of option, as it seems to be more
flexible, e.g. jitter- vs. swarm-like plot.
By the way, is there a simple option to replace the crosses by dots?
"literal set style data point" doesn't work.
The following example including a dummy variable doesn't work properly
as the swarm plot is only activated for the first case (LFP=0) but not
for the second one (LFP=1):
<hansl>
open mroz87.gdt --quiet
lww = log(WW)
list X = lww WE LFP
plot X
option fit=none
end plot --output=display
plot X
option fit=none
literal set jitter spread 0.1 #square
end plot --output=display
</hansl>
Artur