scatter - markersize

David Bateman David.Bateman at motorola.com
Wed Mar 19 10:59:54 CDT 2008


Christoph Keller wrote:
> in my opinion, scatter(X,Y,S) places the scatter-marks constant in size, even
> if a "weigth"-vector S is given as an argument of scatter.
>
> In __scatter__.m I found:
>
>   h = patch("faces", [1:length(x)].', "vertices", [x, y, z], "facecolor",
> 	      "none", "edgecolor", "flat", "cdata", c, "marker", marker, 
> 	      "markersize", s, "linestyle", "none");
>
> where 's' is a scalar rather than a vector. Is this by design or by
> accident?
>
> thank you for your comments, sincerely
> Christoph Keller
> (octave 3.0.0, Windows XP)
>   

The calculation of "s" in __scatter__.m is

<quote>
  if (istart < nargin && firstnonnumeric > istart)
    s = varargin{istart};
    if (isempty (s))
      s = 8;
    endif
  else
    s = 8;
  endif
  ## Note markersize is in points^2 for 2D and points for 3D, and
  ## the below is an approximation, that is empircally visually correct.
  if (nd == 2)
    s = sqrt (s) / 2;
  else
    s = s / 4;
  endif
</quote>

Therefore if you pass a value for s as a vector, it is passed to patch
as a vector.. The code

 n = 100; x = randn(n,1); y = randn(n,1); c = sqrt(x.^2 + y.^2);
scatter(x, y, 1:100, c)

works fine for me under Octave 3.0.0 and gnuplot 4.2.3 that I'm using..
However, it appears to be broken under 3.1.x

D.

-- 
David Bateman                                David.Bateman at motorola.com
Motorola Labs - Paris                        +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 6 72 01 06 33 (Mob) 
91193 Gif-Sur-Yvette FRANCE                  +33 1 69 35 77 01 (Fax) 

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary



More information about the Bug-octave mailing list