Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: st: RE: Stata 13 linepatternstyle
From
Kieran McCaul <[email protected]>
To
"[email protected]" <[email protected]>
Subject
RE: st: RE: Stata 13 linepatternstyle
Date
Fri, 2 Aug 2013 14:05:53 +0800
....
If I set up a scheme with the following and save it as -new1.scheme-.
#include s1color
color p1 black
color p2 black
linepattern p1 solid
linepattern p2 dot
Then all of the follow will produce what you want:
set scheme new1
graph twoway function y=normal(.3372456+(.837738*x)), ///
xscale(range(0 .9)) xlabel(0(.1).9) ylabel(0(.1)1) ///
legend(label(1 "Bivariate") label(2 "Direct Effects")) ///
|| ///
function y=normal(.3263623+.0249095+(.9102603*x)), ///
xscale(range(0 .9)) xlabel(0(.1).9) ylabel(0(.1)1) ///
legend(label(1 "Bivariate") label(2 "Direct Effects")) ///
graph twoway function y=normal(.3372456+(.837738*x)) || ///
function y=normal(.3263623+.0249095+(.9102603*x)), ///
xscale(range(0 .9)) xlabel(0(.1).9) ylabel(0(.1)1) ///
legend(label(1 "Bivariate") label(2 "Direct Effects"))
twoway (function y=normal(.3372456+(.837738*x))) ///
(function y=normal(.3263623+.0249095+(.9102603*x))), ///
xscale(range(0 .9)) xlabel(0(.1).9) ylabel(0(.1)1) ///
legend(label(1 "Bivariate") label(2 "Direct Effects"))
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Lucas
Sent: Friday, 2 August 2013 9:59 AM
To: [email protected]
Cc: Samuel Lucas
Subject: Re: st: RE: Stata 13 linepatternstyle
That's funny. When I use lpattern (which I used originally) and only
list one input as you did, it works. But, I can show anyone dozens of
graphs I have made over the last 7 years with:
lpattern("-.-" "...")
that worked (under the || specification). So, while this makes it
possible for me to make the graph, it raises concern that the syntax
no longer accepts former input. Page 459 of the Stata13 graphics
manual states:
In certain contexts (for example, scatter; see [G-2] graph twoway
scatter), the lpattern(), lwidth(), lcolor(), and lstyle() options may
be specified with a list of elements, with the first element applying
to the first variable, the second element to the second variable, and
so on. For information on specifying lists, see [G-4] stylelists.
It seems function plots in the || syntax used to be such a context,
and now it may not be. Or, I have done something else off and its
messing up the context.
Anyway, glad I can go ahead and make this graph. Thanks, Phil, Alan,
and Sergiy.
Sam
On Thu, Aug 1, 2013 at 6:45 PM, Phil Clayton
<[email protected]> wrote:
> Sorry to belabour the point, but did you definitely use my lpattern() as opposed to your linepatternstyle() ?
>
> Your linepatternstyle() option doesn't work on my Stata 12 or 13.
>
> Phil
>
> On 02/08/2013, at 11:03 AM, Lucas <[email protected]> wrote:
>
>> Did it as you suggest. I still get:
>>
>> option linepatternstyle() not allowed
>>
>> Sam
>>
>> On Thu, Aug 1, 2013 at 6:30 PM, Phil Clayton
>> <[email protected]> wrote:
>>> Maybe I'm missing something, but I'm confused why you are not using something like:
>>>
>>> . graph twoway function y=normal(.3372456+(.837738*x)),
>>> xscale(range(0 .9)) xlabel(0(.1).9) ylabel(0(.1)1)
>>> legend(label(1 "Bivariate") label(2 "Direct Effects"))
>>> lpattern(solid)
>>> ||
>>> function y=normal(.3263623+.0249095+(.9102603*x)),
>>> xscale(range(0 .9)) xlabel(0(.1).9) ylabel(0(.1)1)
>>> legend(label(1 "Bivariate") label(2 "Direct Effects"))
>>> lpattern(dot) ;
>>>
>>> Phil
>>>
>>> On 02/08/2013, at 10:51 AM, Lucas <[email protected]> wrote:
>>>
>>>> Here's one version of my code which does not work:
>>>>
>>>> . graph twoway function y=normal(.3372456+(.837738*x)),
>>>> xscale(range(0 .9)) xlabel(0(.1).9) ylabel(0(.1)1)
>>>> legend(label(1 "Bivariate") label(2 "Direct Effects"))
>>>> linepatternstyle(solid dot)
>>>> ||
>>>> function y=normal(.3263623+.0249095+(.9102603*x)),
>>>> xscale(range(0 .9)) xlabel(0(.1).9) ylabel(0(.1)1)
>>>> legend(label(1 "Bivariate") label(2 "Direct Effects"))
>>>> linepatternstyle(solid dot) ;
>>>> option linepatternstyle() not allowed
>>>>
>>>> and here's another that does not work:
>>>>
>>>> . graph twoway function y=normal(.3372456+(.837738*x)),
>>>>> xscale(range(0 .9))
>>>>> xlabel(0(.1).9)
>>>>> ylabel(0(.1)1)
>>>>> legend(label(1 "Bivariate") label(2 "Direct Effects"))
>>>>> linepatternstyle("-" ".")
>>>>> ||
>>>>> function y=normal(.3263623+.0249095+(.9102603*x)),
>>>>> xscale(range(0 .9))
>>>>> xlabel(0(.1).9)
>>>>> ylabel(0(.1)1)
>>>>> legend(label(1 "Bivariate") label(2 "Direct Effects"))
>>>>> linepatternstyle("-" ".") ;
>>>> option linepatternstyle() not allowed
>>>>
>>>> Thanks for any assistance.
>>>>
>>>> On Thu, Aug 1, 2013 at 2:26 PM, Feiveson, Alan H. (JSC-SK311)
>>>> <[email protected]> wrote:
>>>>> Sam - A far as I know, -lpatternstyle_ works fine in Stata 13. Please include (an example) of the graph command you used that caused this problem.
>>>>>
>>>>> Al Feiveson
>>>>>
>>>>> -----Original Message-----
>>>>> From: [email protected] [mailto:[email protected]] On Behalf Of Lucas
>>>>> Sent: Thursday, August 01, 2013 4:15 PM
>>>>> To: [email protected]
>>>>> Cc: Samuel Lucas
>>>>> Subject: st: Stata 13 linepatternstyle
>>>>>
>>>>> Anyone know what's up with linepatternstyle in stata13? In graphing a few functions in the same graph, no matter what I do all lines are solid (though the shading may differ). I tried setting mono but that no longer works (horrors for all those graphs I coded several years ago, if I have to re-make some sometime). I used s1mono and s2mono and at worst all lines are the same (solid, same shade), and at best they differ only in shade. But I need differences in pattern (e.g., solid, dotted, and so forth).
>>>>>
>>>>> Is this a bug? Or, is there a new command of which I do not know that one needs to use to set the pattern for (one or more) lines in the same graph? Inquiring minds want to know (and will be very grateful for guidance!)!
>>>>>
>>>>> Thanks in advance.
>>>>> Sam
>>>>> *
>>>>> * For searches and help try:
>>>>> * http://www.stata.com/help.cgi?search
>>>>> * http://www.stata.com/support/faqs/resources/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/faqs/resources/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/faqs/resources/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/faqs/resources/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/faqs/resources/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/faqs/resources/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/faqs/resources/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/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/