Quantcast

Remove legends for few line graphs in a figure that has many

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Remove legends for few line graphs in a figure that has many

ashokankur
I have a figure that has many line graphs. I just want to remove the lengend of few of them. If I use the option "off" all the legends are removed. How do I do this?
Secondly, How do I fill the area between two line graphs?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

AW: Remove legends for few line graphs in a figure that has many

Martin Weiss-5

<>

Just a dopey example to illustrate the point:


*************
sysuse auto, clear
xtline price, overlay i(rep78) t(headroom) legend(order(1 "rep78==1" 5
"rep78==5"))
*************


What is the "area between two line graphs", exactly?

HTH
Martin


-----Urspr√ľngliche Nachricht-----
Von: [hidden email]
[mailto:[hidden email]] Im Auftrag von ashokankur
Gesendet: Dienstag, 24. August 2010 17:35
An: [hidden email]
Betreff: st: Remove legends for few line graphs in a figure that has many

I have a figure that has many line graphs. I just want to remove the lengend
of few of them. If I use the option "off" all the legends are removed. How
do I do this?
Secondly, How do I fill the area between two line graphs?
--
View this message in context:
http://statalist.1588530.n2.nabble.com/Remove-legends-for-few-line-graphs-in
-a-figure-that-has-many-tp5457368p5457368.html
Sent from the Statalist mailing list archive at Nabble.com.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Remove legends for few line graphs in a figure that has many

Maarten buis
In reply to this post by ashokankur
--- On Tue, 24/8/10, ashokankur wrote:
> How do I fill the area between two line graphs?

-help twoway rarea-

There is a fancy example here:
http://www.stata.com/statalist/archive/2008-11/msg01318.html

Hope this helps,
Maarten

--------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://www.maartenbuis.nl
--------------------------


     

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: AW: Remove legends for few line graphs in a figure that has many

ashokankur
In reply to this post by Martin Weiss-5
Martin,

This is the command I write

graph tw (line y1 y0 pce , sort clcolor(black dknavy ) clwidth(thick thick ) xtitle("Per Capita Expenditure ", margin(vsmall)) ytitle("Annual Firewood Collection in Bharis", margin(vsmall))
xlab(0(10000)55000) ylab(0(20)120, nogrid)
ytic(0(10)120) leg(on col(1) ring(5) pos(3) stack label(1 "with FUG") label(2 "without FUG" )   ))  ///
(line z1 z2 z3 z4 pce_c , sort  leg(off))

The problem is  when I run this none on the legends remain.
I want the legends (line y1 y0 pce) to remain, while I don't want the legends for (line z1 z2 z3 z4 pce)
Can that be done?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: AW: Remove legends for few line graphs in a figure that has many

ashokankur
btw I have a older version of Stata Stata8.2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Re: AW: Remove legends for few line graphs in a figure that has many

Nick Cox
In reply to this post by ashokankur
The last thing you say about the legend is -legend(off)-. So that is what you should expect from your syntax, no legend, because the last -legend()- option applies to the entire graph, not what is produced by the second -line- command alone.

Martin already indicated what is needed for your problem, the use of -order()-.

I guess at

graph tw (line y1 y0 pce , sort clcolor(black dknavy ) clwidth(thick thick )
xtitle("Per Capita Expenditure ", margin(vsmall)) ytitle("Annual Firewood
Collection in Bharis", margin(vsmall))
xlab(0(10000)55000) ylab(0(20)120, nogrid)
ytic(0(10)120) leg(on order(1 2 3) col(1) ring(5) pos(3) stack label(1 "with FUG")
label(2 "without FUG" )   ))  ///
(line z1 z2 z3 z4 pce_c , sort)

Nick
[hidden email]

ashokankur

This is the command I write

graph tw (line y1 y0 pce , sort clcolor(black dknavy ) clwidth(thick thick )
xtitle("Per Capita Expenditure ", margin(vsmall)) ytitle("Annual Firewood
Collection in Bharis", margin(vsmall))
xlab(0(10000)55000) ylab(0(20)120, nogrid)
ytic(0(10)120) leg(on col(1) ring(5) pos(3) stack label(1 "with FUG")
label(2 "without FUG" )   ))  ///
(line z1 z2 z3 z4 pce_c , sort  leg(off))

The problem is  when I run this none on the legends remain.
I want the legends (line y1 y0 pce) to remain, while I don't want the
legends for (line z1 z2 z3 z4 pce)
Can that be done?

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Re: AW: Remove legends for few line graphs in a figure that has many

Nick Cox
In reply to this post by ashokankur
That makes no difference here. It will _often_ make a big difference to any future questions you might have, so remember to flag it every time.

Nick
[hidden email]

ashokankur

btw I have a older version of Stata Stata8.2

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
Loading...