Dear Stata experts!
I have a question regarding the scatterplot. I tried to search the forum (as well as other I-net resources) but found nothing which would help.
So, here is the problem:
I have a cohort of workers and want to make certain scatterplot. On x-axis I have worker's age while on y-axis I have worker's duration of the follow-up, both as continuous variables. So, each point on this plot represents one worker and the location of the dot is defined by values of the two variables. In the same time I have another variable, representing accumulated risk of, say, lung cancer death related to exposure at work. This latter variable is continuous and changes within range [0 1]. What I want is to make a scatterplot where the color of the dots would represent the value of the risk. I can easily categorize risk variable and make a twoway plot of several categories in several colors but using colors changing smoothly seems a more elegant solution. I read here more or less similar question, but there was no solution - which I am not sure even exists. So, anyway, any suggestions would be very much appreciated.
I have a question regarding the scatterplot. I tried to search the forum (as well as other I-net resources) but found nothing which would help.
So, here is the problem:
I have a cohort of workers and want to make certain scatterplot. On x-axis I have worker's age while on y-axis I have worker's duration of the follow-up, both as continuous variables. So, each point on this plot represents one worker and the location of the dot is defined by values of the two variables. In the same time I have another variable, representing accumulated risk of, say, lung cancer death related to exposure at work. This latter variable is continuous and changes within range [0 1]. What I want is to make a scatterplot where the color of the dots would represent the value of the risk. I can easily categorize risk variable and make a twoway plot of several categories in several colors but using colors changing smoothly seems a more elegant solution. I read here more or less similar question, but there was no solution - which I am not sure even exists. So, anyway, any suggestions would be very much appreciated.
Comment