On Sat, 23 Apr 2011, Ferenci Tamas wrote:
I was just wondering: is it somehow possible to create a scatter
plot
where markers depend on a categorical (but not dummy, i.e. not binary)
variable? View / Graph specified vars / X-Y with factor separation
looked promising, but it only allows dummy variables as separating
factors, so the points can only be partitioned into two sets. Is it
somehow possible to extend this to more than two...?
It's not a built-in command, but it's not very difficult. Suppose
you have a "treatment" variable x and a "response" variable y, and
you want to plot y against x, with the points distinguished by the
associated value of some discrete variable d. Then:
<script>
matrix dvals = values(d)
nd = rows(dvals)
list yd = null
loop i=1..nd
series y$i = (d == dvals[i]) ? y : NA
yd = yd y$i
endloop
gnuplot yd x --output=display # or whatever option
</script>
Allin Cottrell