⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 axis_scale_options.hlp

📁 是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到
💻 HLP
字号:
{smcl}
{* 05mar2005}{...}
{cmd:help axis_scale_options}
{hline}
{* index axis line, look of}{...}
{* index tscale() tt option}{...}
{* index xscale() tt option}{...}
{* index yscale() tt option}{...}
{* index scale, log}{...}
{* index scale, reversed}{...}
{* index axis, log}{...}
{* index axis, reversed}{...}
{* index axis, suppressing}{...}

{title:Title}

{p2colset 5 31 33 2}{...}
{p2col :{hi:[G] {it:axis_scale_options}} {hline 2}}Options for specifying axis scale, range, and look{p_end}
{p2colreset}{...}


{title:Syntax}

{pstd}
{it:axis_scale_options} are a subset of {it:axis_options};
see {it:{help axis_options}}.

	{it:axis_scale_options}{col 40}description
	{hline 70}
	{cmdab:ysc:ale:(}{it:axis_suboptions}{cmd:)}{...}
{col 40}how {it:y} axis looks
	{cmdab:xsc:ale:(}{it:axis_suboptions}{cmd:)}{...}
{col 40}how {it:x} axis looks
	{cmdab:tsc:ale:(}{it:axis_suboptions}{cmd:)}{...}
{col 40}how {it:t} (time) axis looks
	{hline 70}
{pin}
The above options are
{it:merged-implicit}; see {help repeated options}.

	{it:axis_suboptions}{col 40}description
	{hline 70}
	{cmdab:ax:is:(}{it:#}{cmd:)}{...}
{col 40}which axis to modify; 1 {ul:<} {it:#} {ul:<} 9
	[{cmd:no}]{cmd:log}{...}
{col 40}use logarithmic scale
	[{cmdab:no:}]{cmdab:rev:erse}{...}
{col 40}reverse scale to run from max to min
	{cmdab:r:ange:(}{it:{help numlist}}{cmd:)}{...}
{col 40}expand range of axis
	{cmdab:r:ange:(}{it:{help datelist}}{cmd:)}{...}
{col 40}expand range of {it:t} axis ({cmd:tscale()} only)

	{cmd:off} and {cmd:on}{...}
{col 40}suppress/force display of axis
	{cmd:fill}{...}
{col 40}allocate space for axis even if {cmd:off}
	{cmd:alt}{...}
{col 40}move axis from left to right or
{col 40}  from top to bottom

	{cmdab:fex:tend}{...}
{col 40}extend axis line through plot region
{col 40}   and plot region's margin
	{cmdab:ex:tend}{...}
{col 40}extend axis line through plot region
	{cmdab:noex:tend}{...}
{col 40}do not extend axis line at all
	{cmdab:noli:ne}{...}
{col 40}do not draw axis line
	{cmdab:li:ne}{...}
{col 40}force drawing of axis line

	{cmdab:titleg:ap:(}{it:{help relativesize}}{cmd:)}{...}
{col 40}margin between axis title and
{col 40}    tick labels
	{cmdab:outerg:ap:(}{it:{help relativesize}}{cmd:)}{...}
{col 40}margin outside of axis title

	{cmdab:lsty:le:(}{it:{help linestyle}}{cmd:)}{...}
{col 40}overall style of axis line
	{cmdab:lc:olor:(}{it:{help colorstyle}}{cmd:)}{...}
{col 40}color of axis line
	{cmdab:lw:idth:(}{it:{help linewidthstyle}}{cmd:)}{...}
{col 40}thickness of axis line
	{cmdab:lp:attern:(}{it:{help linepatternstyle}}{cmd:)}{...}
{col 40}axis pattern (solid, dashed, etc.)
	{hline 70}


{title:Description}

{pstd}
The {it:axis_scale_options} determine how axes are scaled (arithmetic, log,
reversed), the range of the axes, and the look of the lines that are the axes.


{title:Options}

{phang}
{opt yscale(axis_suboptions)}, {opt xscale(axis_suboptions)}, and {opt tscale(suboptions)}
    specify the look of the {it:y}, {it:x}, and {it:t} axes.  The {it:t} axis
    is an extension of the {it:x} axis.  Inside the parentheses, you specify
    {it:axis_suboptions}.


{title:yscale(), xscale(), and tscale() suboptions}

{phang}
{cmd:axis(}{it:#}{cmd:)}
     specifies to which scale this axis belongs and is specified when
     dealing with multiple {it:y} or {it:x} axes; see 
     {it:{help axis_choice_options}}.

{phang}
{cmd:log} and {cmd:nolog}
    specify whether the scale should be logarithmic or arithmetic.
    {cmd:nolog} is the usual default, so {cmd:log} is the option.
    See {help axis_scale_options##remarks3:Obtaining log scales} under
    {hi:Remarks} below.

{phang}
{cmd:reverse} and {cmd:noreverse}
     specify whether the scale should run from the maximum to the minimum
     or from the minimum to the maximum.
     {cmd:noreverse} is the usual default, so {cmd:reverse} is the
     option.
     See {help axis_scale_options##remarks4:Obtaining reversed scales} under
     {hi:Remarks} below.

{phang}
{cmdab:range(}{it:numlist}{cmd:)}
    specifies that the axis be expanded to include
    the numbers specified.  Missing values, if specified, are ignored.
    See {help axis_scale_options##remarks2:Specifying the range of a scale}
    under {hi:Remarks} below.

{phang}
{cmdab:range(}{it:datelist}{cmd:)} ({cmd:tscale()} only)
    specifies that the axis be expanded to include the specified dates;
    see {it:{help datelist}}.  Missing values, if specified, are ignored.
    See {help tsline} for examples.

{phang}
{cmd:off} and {cmd:on}
    suppress or force the display of the axis.
    {cmd:on} is the default and {cmd:off} the option.
    See {help axis_scale_options##remarks5:Suppressing the axes} under
    {hi:Remarks} below.

{phang}
{cmd:fill} goes with {cmd:off} and is seldom
    specified.  If you turned an axis off but still wanted the space to be
    allocated for the axis, you could specify {cmd:fill}.

{phang}
{cmd:alt} specifies that, if the axis is by default on the left, it be on
    the right; if it is by default on the bottom, it is to be on the top.
    The following would draw a scatterplot with the {it:y} axis on the
    right:

{phang3}
{cmd:. scatter yvar xvar, yscale(alt)}

{phang}
{cmd:fextend}, {cmd:extend}, {cmd:noextend}, {cmd:line}, and {cmd:noline}
    determine how much of the line representing the axis is to be drawn.  They
    are alternatives.

{pmore}
    {cmd:noline} specifies that the line not be drawn at all.  The axis
    is there, ticks and labels will appear, but the line that is the axis
    itself will not be drawn.

{pmore}
    {cmd:line} is the opposite of {cmd:noline}, for use if the axis line
    somehow got turned off.

{pmore}
    {cmd:noextend} specifies that the axis line not extend beyond the
    range of the axis.  Say that the axis extends from -1 to +20.
    With {cmd:noextend}, the axis line begins at -1 and ends at +20.

{pmore}
    {cmd:extend} specifies that the line be longer than that and extend
    all the way across the plot region.  For instance, -1 and +20 might be the
    extent of the axis, but the scale might extend from -5 to +25, with the
    range [-5,-1) and (20,25] being unlabeled on the axis.  With {cmd:extend},
    the axis line begins at -5 and ends at 25.

{pmore}
    {cmd:fextend} specifies that the line be longer than that and
    extend across the plot region and across the plot region's margins.  For a
    definition of the plot region's margins, see 
    {it:{help region_options}}.  If the plot region has no margins (which
    would be rare), {cmd:fextend} means the same as {cmd:extend}.  If the
    plot region does have margins, {cmd:extend} would result in the {it:y} and
    {it:x} axes not meeting.  With {cmd:fextend}, they touch.

{pmore}
    {cmd:fextend} is the default with most schemes.

{phang}
{cmd:titlegap(}{it:relativesize}{cmd:)} specifies the margin to be inserted
     between the axis title and the axis tick labels.

{phang}
{cmd:outergap(}{it:relativesize}{cmd:)} specifies the margin to be inserted
     outside of the axis title.

{phang}
{cmd:lstyle(}{it:linestyle}{cmd:)},
{cmd:lcolor(}{it:colorstyle}{cmd:)},
{cmd:lwidth(}{it:linewidthstyle}{cmd:)}, and
{cmd:lpattern(}{it:linepatternstyle}{cmd:)}
determine the overall look of the line that is the axis;
see {help lines}.


{title:Remarks}

{pstd}
Remarks are presented under the headings

	{help axis_scale_options##remarks1:Use of the yscale() and xscale()}
	{help axis_scale_options##remarks2:Specifying the range of a scale}
	{help axis_scale_options##remarks3:Obtaining log scales}
	{help axis_scale_options##remarks4:Obtaining reversed scales}
	{help axis_scale_options##remarks5:Suppressing the axes}

{pstd}
{it:axis_scale_options} are a subset of {it:axis_options};
see {it:{help axis_options}} for an overview.
The other appearance options are

	{it:axis_label_options}{right:(see {it:{help axis_label_options}})  }

	{it:axis_title_options}{right:(see {it:{help axis_title_options}})  }


{marker remarks1}{...}
{title:Use of the yscale() and xscale()}

{* index yscale() tt option}{* index xscale() tt option}{...}
{pstd}
{cmd:yscale()} and {cmd:xscale()} specify the look of the {it:y}
and {it:x} axes.  Inside the parentheses, you specify {it:axis_suboptions},
for example:

{pmore}
{cmd:. twoway (scatter} ...{cmd:)} ...{cmd:,}
{cmd:yscale(range(0 10) titlegap(1))}

{pstd}
Note that {cmd:yscale()} and {cmd:xscale()} may be abbreviated {cmd:ysc()}
and {cmd:xsc()}, suboption {cmd:range()} may be abbreviated
{cmd:r()}, and {cmd:titlegap()} may be abbreviated {cmd:titleg()}:

{pmore}
{cmd:. twoway (scatter} ...{cmd:)} ...{cmd:,}
{cmd:ysc(r(0 10) titleg(1))}

{pstd}
Multiple {cmd:yscale()} and {cmd:xscale()} options may be specified on the
same command, and their results will be combined.  Thus the
above command could also be specified

{pmore}
{cmd:. twoway (scatter} ...{cmd:)} ...{cmd:,}
{cmd:ysc(r(0 10)) ysc(titleg(1))}

{pstd}
Suboptions may also be specified more than once, either within a single
{cmd:yscale()} or {cmd:xscale()} option, or across multiple options, and
the rightmost suboption will take effect.  In the following command,
{cmd:titlegap()} will be 2 and {cmd:range()}, 0 and 10:

{pmore}
{cmd:. twoway (scatter} ...{cmd:)} ...{cmd:,}
{cmd:ysc(r(0 10)) ysc(titleg(1)) ysc(titleg(2))}


{marker remarks2}{...}
{title:Specifying the range of a scale}

{* index scale, range of}{* index axis range}{...}
{pstd}
To specify the range of a scale, specify the
{c -(}{cmd:y}|{cmd:x}{c )-}{cmd:scale(range(}{it:numlist}{cmd:))}
option.  This option specifies that the axis be expanded to include the
numbers specified.

{pstd}
Consider the graph

	{cmd:. scatter} {it:yvar} {it:xvar}

{pstd}
Assume that it resulted in a graph where the {it:y} axis varied over 1 to 100
and assume that, given the nature of the {it:y} variable, it would be more
natural if the range of the axis were expanded to go from 0 to 100.  You could
type

{phang2}
	{cmd:. scatter} {it:yvar xvar}{cmd:, ysc(r(0))}

{pstd}
Similarly, if the range without the {cmd:yscale(range())} option went from 1 to
99 and you wanted it to go from 0 to 100, you could type

{phang2}
	{cmd:. scatter} {it:yvar xvar}{cmd:, ysc(r(0 100))}

{pstd}
If the range without {cmd:yscale(range())} went from 0 to 99 and you wanted it
to go from 0 to 100, you could type

{phang2}
	{cmd:. scatter} {it:yvar xvar}{cmd:, ysc(r(100))}

{pstd}
Specifying missing for a value leaves the current minimum or maximum
unchanged; specifying a nonmissing value changes the range, but only if the
specified value is outside the value that would otherwise have been chosen.
{cmd:range()} never narrows the scale of an axis or causes data to be omitted
from the plot.  If you wanted to graph {cmd:yvar} versus {cmd:xvar} for the
subset of {cmd:xvar} values between 10 and 50, typing

{phang2}
	{cmd:. scatter} {it:yvar xvar}{cmd:, xsc(r(10 50))}

{pstd}
would not suffice.  You need to type

{phang2}
	{cmd:. scatter} {it:yvar xvar} {cmd:if} {it:xvar}{cmd:>=10 &} {it:xvar}{cmd:<=50}


{marker remarks3}{...}
{title:Obtaining log scales}

{* index log scales}{* index axis, log}{* index scales, log}{...}
{pstd}
To obtain log scales specify the
{c -(}{cmd:y}|{cmd:x}{c )-}{cmd:scale(log)}
option.
Ordinarily when you draw a graph, you obtain arithmetic scales:

	{cmd:. sysuse lifeexp, clear}

	{cmd:. scatter lexp gnppc}
	  {it:({stata "gr_example lifeexp: scatter lexp gnppc":click to run})}
{* graph axsca1}{...}

{pstd}
To obtain the same graph with a log {it:x} scale, we type

	{cmd:. scatter lexp gnppc, xscale(log)}
	  {it:({stata "gr_example lifeexp: scatter lexp gnppc, xscale(log)":click to run})}
{* graph axsca2}{...}

{pstd}
We obtain the same graph as if we typed

	{cmd:. generate log_gnppc = log(gnppc)}

	{cmd:. scatter lexp log_gnppc}

{pstd}
The difference concerns the labeling of the axis.  When we specify
{c -(}{cmd:y}|{cmd:x}{c )-}{cmd:scale(log)}, the axis is labeled
in natural units.  In this case, the overprinting of the 30,000 and 40,000
is unfortunate, but we could fix that by dividing {cmd:gnppc} by 1,000.


{marker remarks4}{...}
{title:Obtaining reversed scales}

{* index reversed scales}{* index axis, reversed}{* scales, reversed}{...}
{pstd}
To obtain reversed scales{hline 2}scales that run from high to
low{hline 2}specify the {c -(}{cmd:y}|{cmd:x}{c )-}{cmd:scale(reverse)}
option:

	{cmd:. sysuse auto, clear}

	{cmd:. scatter mpg weight, yscale(rev)}
	  {it:({stata "gr_example auto: scatter mpg weight, yscale(rev)":click to run})}
{* graph axsca3}{...}


{marker remarks5}{...}
{title:Suppressing the axes}

{* index axes, suppressing}{...}
{pstd}
There are two ways to suppress the axes.  The first is to turn them off
completely, which means that the axis line is suppressed, along
with all of its ticking, labeling, and titling.
The second is to simply suppress the axis line while leaving
the ticking, labeling, and titling in place.

{pstd}
The first is done by
{c -(}{cmd:y}|{cmd:x}{c )-}{cmd:scale(off)}
and the second by
{c -(}{cmd:y}|{cmd:x}{c )-}{cmd:scale(noline)}.
In addition, you will probably need to specify the
{cmd:plotregion(style(none))} option; see {it: {help region_options}}.

{pstd}
The axes and the border around the plot region are right on top of each
other.  Specifying {cmd:plotregion(style(none))} will do away with the
border and reveal the axes to us:

	{cmd:. sysuse auto, clear}

	{cmd:. scatter mpg weight, plotregion(style(none))}
	  {it:({stata "gr_example auto: scatter mpg weight, plotregion(style(none))":click to run})}
{* graph axsca4}{...}

{pstd}
To eliminate the axes in their entirety, type

	{cmd:. scatter mpg weight, plotregion(style(none))}
	{cmd:                      yscale(off) xscale(off)}
	  {it:({stata "gr_example auto: scatter mpg weight, plotregion(style(none)) yscale(off) xscale(off)":click to run})}
{* graph axsca5}{...}

{pstd}
To eliminate the lines that are the axes while leaving in place the
labeling, ticking, and titling, type

	{cmd:. scatter mpg weight, plotregion(style(none))}
	{cmd:                      yscale(noline) xscale(noline)}
	  {it:({stata "scatter mpg weight, plotregion(style(none)) yscale(noline) xscale(noline)":click to run})}
{* graph axsca6}{...}

{pstd}
Rather than using
{c -(}{cmd:y}|{cmd:x}{c )-}{cmd:scale(noline)},
you may specify
{c -(}{cmd:y}|{cmd:x}{c )-}{cmd:scale(lstyle(noline))}
or
{c -(}{cmd:y}|{cmd:x}{c )-}{cmd:scale(lstyle(none))}.
They all mean the same thing.


{title:Also see}

{psee}
Manual:  {bf:[G] {it:axis_scale_options}}

{psee}
Online:  {it:{help axis_options}};
{it:{help axis_label_options}},
{it:{help axis_title_options}};
{it:{help region_options}};
{it:{help datelist}};
{helpb tsline}
{p_end}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -