Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem with "ghost" markers using -twoway line- with a very thick but opaque line.

    I use -twoway line- with a thick but relatively opaque line because I wanted to indicate a certain level/benchmark in -twoway scatter- with the -by- option.
    But I end up getting ghost "markers" in the thick line. Here is a contrived example to illustrate.

    Code:
    sysuse auto.dta, clear
    keep if strpos(make,"Buick") | strpos(make,"Datsun")
    gen benchmark = 3 if strpos(make,"Buick")
    replace benchmark = 4 if strpos(make,"Datsun")
    sort foreign headroom
    twoway  (scatter rep78 headroom, ylabel(1(1)5) xlabel(1(1)5) ) ///
            (line benchmark headroom, lwidth(vvvthick) lcolor(red%20) ), by(foreign)
    And here is the graph it creates
    Click image for larger version

Name:	myexample.png
Views:	4
Size:	70.9 KB
ID:	1469791

    The "ghost" markers in the line appear as darker circles, e.g., at Headroom = 2.0 in the graph on the right (and other intermediate points in the line).
    Is there some way to eliminate the darker shading? Or perhaps some other way to create a similar shading effect in a graph?

    Thank you,
    Dave Harless
    Attached Files
    Last edited by Dave Harless; 10 Nov 2018, 13:30.
Working...
X