Hello,
I am looking for what option to use in a twoway scatterplot (by sex) I have produced where I would like the y-axis title to be horizontal and placed on the right hand side of the axis in the plot region just above my scatter points. I have tried angle and ring in the ytitle option but haven't managed to obtain what I want. Any suggestions would be greatly appreciated. Many thanks, Miranda PS: I am using Stata 11 * * 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/ |
<> I would do the horizontal thing in the code ************* sysuse auto, clear twoway (scatter weight price), ytitle(, orientation(horizontal)) ************* and then go into the Graph Editor and change the "Textbox properties" for the y-title, Advanced Tab, Change the x-offset to 30 ( in this particular case). You could record the action and -replay()- it later. HTH Martin -----Ursprüngliche Nachricht----- Von: [hidden email] [mailto:[hidden email]] Im Auftrag von Miranda Kim Gesendet: Dienstag, 2. Februar 2010 12:15 An: [hidden email] Betreff: st: axis title options Hello, I am looking for what option to use in a twoway scatterplot (by sex) I have produced where I would like the y-axis title to be horizontal and placed on the right hand side of the axis in the plot region just above my scatter points. I have tried angle and ring in the ytitle option but haven't managed to obtain what I want. Any suggestions would be greatly appreciated. Many thanks, Miranda PS: I am using Stata 11 * * 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/ |
In reply to this post by mk-6
I'd use a -subtitle()- or -text()- option if I wanted that.
Nick [hidden email] Miranda Kim I am looking for what option to use in a twoway scatterplot (by sex) I have produced where I would like the y-axis title to be horizontal and placed on the right hand side of the axis in the plot region just above my scatter points. I have tried angle and ring in the ytitle option but haven't managed to obtain what I want. * * 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/ |
In reply to this post by Martin Weiss-5
Thank you Martin and Nick for your responses,
I tried using the orientation sub-option but when producing graphs with a by- option it didn't seem to register and kept it the default (vertical) For example: twoway (scatter weight price), by(foreign) ytitle("hello", orientation(horizontal)) I am unsure where to put the text or subtitle option so it doesn't put it in both graphs, as for example: twoway (scatter weight price), by(foreign) text(5050 5050 "hello") Miranda Martin Weiss wrote: > <> > > I would do the horizontal thing in the code > > ************* > sysuse auto, clear > twoway (scatter weight price), ytitle(, orientation(horizontal)) > ************* > > and then go into the Graph Editor and change the "Textbox properties" for > the y-title, Advanced Tab, Change the x-offset to 30 ( in this particular > case). You could record the action and -replay()- it later. > > > HTH > Martin > > > -----Ursprüngliche Nachricht----- > Von: [hidden email] > [mailto:[hidden email]] Im Auftrag von Miranda Kim > Gesendet: Dienstag, 2. Februar 2010 12:15 > An: [hidden email] > Betreff: st: axis title options > > Hello, > I am looking for what option to use in a twoway scatterplot (by sex) I > have produced where I would like the y-axis title to be horizontal and > placed on the right hand side of the axis in the plot region just above > my scatter points. I have tried angle and ring in the ytitle option but > haven't managed to obtain what I want. > Any suggestions would be greatly appreciated. > Many thanks, > Miranda > PS: I am using Stata 11 > > * > * 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/ > > > * * 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/ |
I see your problem.
twoway scatter weight price, by(foreign) ymla(3500 "hello", labsize(*2) ang(h)) ytitle("") is one kludge. Nick [hidden email] Miranda Kim Thank you Martin and Nick for your responses, I tried using the orientation sub-option but when producing graphs with a by- option it didn't seem to register and kept it the default (vertical) For example: twoway (scatter weight price), by(foreign) ytitle("hello", orientation(horizontal)) I am unsure where to put the text or subtitle option so it doesn't put it in both graphs, as for example: twoway (scatter weight price), by(foreign) text(5050 5050 "hello") Martin Weiss wrote: > I would do the horizontal thing in the code > > ************* > sysuse auto, clear > twoway (scatter weight price), ytitle(, orientation(horizontal)) > ************* > > and then go into the Graph Editor and change the "Textbox properties" for > the y-title, Advanced Tab, Change the x-offset to 30 ( in this particular > case). You could record the action and -replay()- it later. Miranda Kim > I am looking for what option to use in a twoway scatterplot (by sex) I > have produced where I would like the y-axis title to be horizontal and > placed on the right hand side of the axis in the plot region just above > my scatter points. I have tried angle and ring in the ytitle option but > haven't managed to obtain what I want. > PS: I am using Stata 11 * * 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/ |
This puts it on the left of the axis with a tick mark. I would rather
have it on the right with no tick mark, any clues? Many thanks for your help, Miranda Nick Cox wrote: > I see your problem. > > twoway scatter weight price, by(foreign) ymla(3500 "hello", labsize(*2) > ang(h)) ytitle("") > > is one kludge. > > Nick > [hidden email] > > Miranda Kim > > Thank you Martin and Nick for your responses, > > I tried using the orientation sub-option but when producing graphs with > a by- option it didn't seem to register and kept it the default > (vertical) > For example: > twoway (scatter weight price), by(foreign) ytitle("hello", > orientation(horizontal)) > I am unsure where to put the text or subtitle option so it doesn't put > it in both graphs, as for example: > twoway (scatter weight price), by(foreign) text(5050 5050 "hello") > > Martin Weiss wrote: > > >> I would do the horizontal thing in the code >> >> ************* >> sysuse auto, clear >> twoway (scatter weight price), ytitle(, orientation(horizontal)) >> ************* >> >> and then go into the Graph Editor and change the "Textbox properties" >> > for > >> the y-title, Advanced Tab, Change the x-offset to 30 ( in this >> > particular > >> case). You could record the action and -replay()- it later. >> > > Miranda Kim > > >> I am looking for what option to use in a twoway scatterplot (by sex) I >> > > >> have produced where I would like the y-axis title to be horizontal and >> > > >> placed on the right hand side of the axis in the plot region just >> > above > >> my scatter points. I have tried angle and ring in the ytitle option >> > but > >> haven't managed to obtain what I want. >> PS: I am using Stata 11 >> > > * > * 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/ |
sysuse auto
local a: variable label weight scatter wei price, by(fore, l("") r1(`a', orientation(horiz) placement(top))) In -by()- graphs, there are no ytitles-, only positional titles: l, r, t, b. Scott On Tue, Feb 2, 2010 at 6:47 AM, Miranda Kim <[hidden email]> wrote: > This puts it on the left of the axis with a tick mark. I would rather have > it on the right with no tick mark, any clues? > Many thanks for your help, > Miranda > * * 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/ |
Thanks Scott,
This puts it on the right hand corner of the plot, whilst I would like it next to the y-axis (since it is the axis title) but on the right hand side of it (rather than the default which is left hand side), the orientation now works, but I still can't get the positioning right. Scott Merryman wrote: > sysuse auto > local a: variable label weight > scatter wei price, by(fore, l("") r1(`a', orientation(horiz) placement(top))) > > In -by()- graphs, there are no ytitles-, only positional titles: l, r, t, b. > > Scott > > > On Tue, Feb 2, 2010 at 6:47 AM, Miranda Kim <[hidden email]> wrote: > >> This puts it on the left of the axis with a tick mark. I would rather have >> it on the right with no tick mark, any clues? >> Many thanks for your help, >> Miranda >> >> > * > * 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/ |
Like this?
sysuse auto local a: variable label weight scatter wei price, yscale(alt) ylabel(,angle(0)) /// by(fore, l("") r1(`a', orientation(horiz) placement(top) margin(t=+5))) You might need to adjust the -margin()- to get the placement correct. Scott * * 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/ |
Thanks Scott,
I will try and play around with it more. I would prefer to keep my y-axis as is the default (on the left), it is simply the placement of the ytitle which I would like in the plot region as follows (supposing the vertical line is my y-axis): | Weight (lbs) | | | | scatter plot region | ------------------------------------ x-axis Scott Merryman wrote: > Like this? > > sysuse auto > local a: variable label weight > scatter wei price, yscale(alt) ylabel(,angle(0)) /// > by(fore, l("") r1(`a', orientation(horiz) placement(top) margin(t=+5))) > > You might need to adjust the -margin()- to get the placement correct. > > Scott > * > * 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/ |
Ok, I think I get it now.
Try this: sysuse auto local a: variable label weight scatter wei price, by(fore, l("") l2(`a', orientation(horiz) placement(top) margin(t=+5 r=-35))) Scott On Tue, Feb 2, 2010 at 8:30 AM, Miranda Kim <[hidden email]> wrote: > Thanks Scott, > I will try and play around with it more. I would prefer to keep my y-axis as > is the default (on the left), it is simply the placement of the ytitle which > I would like in the plot region as follows (supposing the vertical line is > my y-axis): > | Weight (lbs) > | > | > | > | scatter plot region > | > ------------------------------------ x-axis > * * 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/ |
Yes this is it :-) Thanks a lot!
Best wishes, Miranda Scott Merryman wrote: > Ok, I think I get it now. > > Try this: > > sysuse auto > local a: variable label weight > scatter wei price, by(fore, l("") l2(`a', orientation(horiz) > placement(top) margin(t=+5 r=-35))) > > Scott > > On Tue, Feb 2, 2010 at 8:30 AM, Miranda Kim <[hidden email]> wrote: > >> Thanks Scott, >> I will try and play around with it more. I would prefer to keep my y-axis as >> is the default (on the left), it is simply the placement of the ytitle which >> I would like in the plot region as follows (supposing the vertical line is >> my y-axis): >> | Weight (lbs) >> | >> | >> | >> | scatter plot region >> | >> ------------------------------------ x-axis >> >> > > * > * 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/ |
Free forum by Nabble | Edit this page |