[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Scatterplot: Weighted markers change size

From   "Friedrich Huebler" <>
Subject   st: Scatterplot: Weighted markers change size
Date   Tue, 29 Jul 2008 19:36:40 -0400

-scatter- supports weights. When a scatterplot is drawn, all weighted
markers have a distinct size. This size changes when the data are
divided into two or more groups and then drawn as overlaid
scatterplots. I am looking for a way to retain the size of the
original markers. The problem is best understood with an example.

clear all
input x y weight group
1 1 1 1
2 1 10 1
1 2 100 2
2 2 1000 2
scatter y x [w=weight], name(A)
twoway (scatter y x if group==1 [w=weight]) ///
(scatter y x if group==2 [w=weight]), name(B)

Compare graphs A and B. In graph A all four markers have a different
size. In graph B there are two pairs of markers with the same size. I
would like to have the same marker sizes in graph B as in graph A
while keeping the colors that identify the two different groups. How
can I do this?


*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index