Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: How to draw axes in the interior of the plot?


From   Roger Newson <r.newson@imperial.ac.uk>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: How to draw axes in the interior of the plot?
Date   Wed, 15 Sep 2010 14:09:20 +0100

Thanks to Scott for this solution, which I have forwarded to my colleague.

It seems a bit surprising that Stata does not seem to be able routinely to locate axes in the interior of a graph region, instead of at the boundary of a graph region. After all, lots of people might want to plot the complex plane with axes intersecting at (0,0i). However, StataCorp may decide to fix this, when they have time to spare from the innumerable other things they do for us. I might raise it at the Wishes and Grumbles session of the 2011 UK Stata User Meeting, if they haven't fixed it by then.

Best wishes

Roger


Roger B Newson BSc MSc DPhil
Lecturer in Medical Statistics
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute
Imperial College London
Royal Brompton Campus
Room 33, Emmanuel Kaye Building
1B Manresa Road
London SW3 6LR
UNITED KINGDOM
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Email: r.newson@imperial.ac.uk
Web page: http://www.imperial.ac.uk/nhli/r.newson/
Departmental Web page:
http://www1.imperial.ac.uk/medicine/about/divisions/nhli/respiration/popgenetics/reph/

Opinions expressed are those of the author, not of the institution.

On 14/09/2010 13:58, Scott Merryman wrote:
You can use yline() and xline() to recreate the axes and use
-scatteri- for the tick marks and labels.

For example (using Ben Jann's -center-):

sysuse auto, clear	
center mpg price
scatter c_p c_m ,yscale(off) xscale(off) legend(off) ylabel(,nogrid)
graphregion(color(white))  ///
   || scatteri 0 -10 "-10" 0 10 "10" 0 20 "20", mlabpos(6) ms(none)
mlabcolor(black) ///
   || scatteri 0 -10 "|" 0 10 "|" 0 20 "|" , mlabpos(0) msy(none)
mlabcolor(black) ///
   || scatteri -5000 0 "-5000" 5000 0 "5000" 10000 0 "10000",
mlabpos(9) ms(none) mlabcolor(black) ///
   || scatteri -5000 0 "`=char(151)'"  5000  0 "`=char(151)'" 10000 0
"`=char(151)'",  mlabpos(0) ms(none) mlabcolor(black) ///
    yline(0, lc(black)) xline(0, lc(black))


Scott

On Tue, Sep 14, 2010 at 6:05 AM, Roger Newson<r.newson@imperial.ac.uk>  wrote:
Hello All

I suspect that I am being very stupid today, and missing something that
should be obvious. I have a colleague who wants to draw axes in the interior
of the plot region in a Stata graph (as most people do when displaying the
complex or Argand plane with 0+0*i at the centre), complete with tick marks
and labels on whatever side the user chooses. However, I have been looking
through the Stata Version 11 .pdf manuals and the Stata Version 10 hardcopy
manuals, and I cannot find any reference to this possibility, although there
is a lot about putting axes on the left, right, top or bottom of the graph
region, and the possibility of up to 9 axes (presumably to allow outside and
inside labelled ticks at the left, right, top and bottom).

Is there a way to do this in Stata graphics? I have checked all the axis
options and the added_line_options, but can't seem to find a way.

Best wishes

Roger

--
Roger B Newson BSc MSc DPhil
Lecturer in Medical Statistics
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute
Imperial College London
Royal Brompton Campus
Room 33, Emmanuel Kaye Building
1B Manresa Road
London SW3 6LR
UNITED KINGDOM
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Email: r.newson@imperial.ac.uk
Web page: http://www.imperial.ac.uk/nhli/r.newson/
Departmental Web page:
http://www1.imperial.ac.uk/medicine/about/divisions/nhli/respiration/popgenetics/reph/

Opinions expressed are those of the author, not of the institution.
*
*   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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index