[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: vary marker color by external variable

From   Peter Goff <>
Subject   st: vary marker color by external variable
Date   Tue, 4 Aug 2009 14:59:25 -0500

I'm looking for a way to use the color of the marker as an added dimension in a scatter plot. I realize I can create N plots, all with different colors, but I was hoping someone knew of a command to essentially weight (continuously) by color. I've tried to use the RGB mcolor(# # #) option, and tie the color to the range of my results:

gen c1 = 255 - (totl-1)*21
gen c2 = (totl-1)*21

graph twoway scatter Y X, mcolor("c1 0 c2")

I cannot, however, get stata to read "c1" as a variable as opposed to a class color. Any suggestions would be greatly appreciated.

Peter Trabert Goff
PhD student
Department of Leadership, Policy, and Organizations
Vanderbilt University

Peabody #514
230 Appleton Place
Nashville, TN 37203-5721
Tel. 615-415-7844
Fax. 615-322-6596

*   For searches and help try:

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