| 1 |
lars |
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
|
|
2 |
<HTML>
|
|
|
3 |
<HEAD>
|
|
|
4 |
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-iso-8859-1">
|
|
|
5 |
<LINK REL="Start" HREF="index.html">
|
|
|
6 |
<LINK REL="Contents" HREF="toc.html">
|
|
|
7 |
<LINK REL="Prev" HREF="7195InvertingtheYaxis.html">
|
|
|
8 |
<LINK REL="Next" HREF="721Addingbandsofpatternandcolortographs.html">
|
|
|
9 |
<STYLE TYPE="text/css"><!--
|
|
|
10 |
BODY { font-family: serif }
|
|
|
11 |
H1 { font-family: sans-serif }
|
|
|
12 |
H2 { font-family: sans-serif }
|
|
|
13 |
H3 { font-family: sans-serif }
|
|
|
14 |
H4 { font-family: sans-serif }
|
|
|
15 |
H5 { font-family: sans-serif }
|
|
|
16 |
H6 { font-family: sans-serif }
|
|
|
17 |
SUB { font-size: smaller }
|
|
|
18 |
SUP { font-size: smaller }
|
|
|
19 |
PRE { font-family: monospace }
|
|
|
20 |
A { text-decoration: none }
|
|
|
21 |
--></STYLE>
|
|
|
22 |
</HEAD>
|
|
|
23 |
<BODY>
|
|
|
24 |
<A HREF="toc.html">Contents</A>
|
|
|
25 |
<A HREF="7195InvertingtheYaxis.html">Previous</A>
|
|
|
26 |
<A HREF="721Addingbandsofpatternandcolortographs.html">Next</A>
|
|
|
27 |
<HR NOSHADE>
|
|
|
28 |
<H2><A NAME="7_20">7.20 Adjusting the auto-scaling limits - grace value</A>
|
|
|
29 |
</H2>
|
|
|
30 |
<P> By default the auto-scaling algorithm tries to make best possible
|
|
|
31 |
use of screen estate by making the scale as large as possible, i.e. the
|
|
|
32 |
extreme values (min/max) will be on the top and bottom of the scale if
|
|
|
33 |
they happen to fall on a scale-tick. So for example doing a simple line
|
|
|
34 |
plot could look like the plot shown in the below.<DIV class="example">
|
|
|
35 |
<BR> <A href="exframes/frame_example3.2.html" target="blank"><IMG border="0"
|
|
|
36 |
HEIGHT="200" src="img/img/img/img/img/img/example3.2.png" WIDTH="300"></A>
|
|
|
37 |
<BR><B>Figure 100:</B> A typical graph with autoscaling and grace=0 <A href="exframes/frame_example3.2.html"
|
|
|
38 |
target="blank">[src]</A>
|
|
|
39 |
<P></P>
|
|
|
40 |
</DIV></P>
|
|
|
41 |
<P> However you might sometime want to add some extra to the minimum and
|
|
|
42 |
maximum values so that there is some "air" in the graph between the end
|
|
|
43 |
of the scale values and the extreme points in the graphs. This can be
|
|
|
44 |
done by adding a "grace" percentage to the scale. So for example adding
|
|
|
45 |
10% to the y-scale in the image above is done by calling the <A href="../ref/LinearScale.html#_LINEARSCALE_SETGRACE">
|
|
|
46 |
SetGrace()</A> method on the yscale as in</P>
|
|
|
47 |
<P><DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB">
|
|
|
48 |
$graph</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">yaxis</FONT><FONT
|
|
|
49 |
color="#007700">-></FONT><FONT color="#0000BB">scale</FONT><FONT color="#007700">
|
|
|
50 |
-></FONT><FONT color="#0000BB">SetGrace</FONT><FONT color="#007700">(</FONT><FONT
|
|
|
51 |
color="#0000BB">10</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">
|
|
|
52 |
10</FONT><FONT color="#007700">);</FONT><FONT color="#0000BB"></FONT></FONT>
|
|
|
53 |
</CODE></DIV></P>
|
|
|
54 |
<P> These lines add a minimum of 10% to the top and bottom values of the
|
|
|
55 |
scale. Note that we say "minimum" since depending on the specific tick
|
|
|
56 |
values choose this might be a little bit more to make the end of the
|
|
|
57 |
scale fall on an even tick mark.</P>
|
|
|
58 |
<P> Adding this line to the previous graph will result in the following
|
|
|
59 |
example</P>
|
|
|
60 |
<P><DIV class="example">
|
|
|
61 |
<BR> <A href="exframes/frame_example3.2.1.html" target="blank"><IMG border="0"
|
|
|
62 |
HEIGHT="200" src="img/img/img/img/img/img/example3.2.1.png" WIDTH="300"></A>
|
|
|
63 |
<BR><B>Figure 101:</B> Adding 10% grace value to top and bottom of the
|
|
|
64 |
Y-scale <A href="exframes/frame_example3.2.1.html" target="blank">[src]</A>
|
|
|
65 |
|
|
|
66 |
<P></P>
|
|
|
67 |
</DIV></P>
|
|
|
68 |
<P> Since we haven't adjusted the position of the X-axis it will remain
|
|
|
69 |
at Y=0 which might not necessary be what we would like so we therefor
|
|
|
70 |
also add the line</P>
|
|
|
71 |
<P><DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB">
|
|
|
72 |
$graph</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">xaxis</FONT><FONT
|
|
|
73 |
color="#007700">-></FONT><FONT color="#0000BB">SetPos</FONT><FONT color="#007700">
|
|
|
74 |
(</FONT><FONT color="#DD0000">"min"</FONT><FONT color="#007700">);</FONT><FONT
|
|
|
75 |
color="#0000BB"></FONT></FONT></CODE></DIV></P>
|
|
|
76 |
<P></P>
|
|
|
77 |
<P> So that the X-axis always will remain at the lowest possible
|
|
|
78 |
Y-value. Doing this will then result in the example below</P>
|
|
|
79 |
<P><DIV class="example">
|
|
|
80 |
<BR> <A href="exframes/frame_example3.2.2.html" target="blank"><IMG border="0"
|
|
|
81 |
HEIGHT="200" src="img/img/img/img/img/img/example3.2.2.png" WIDTH="300"></A>
|
|
|
82 |
<BR><B>Figure 102:</B> Using grace but also adjusting the position of
|
|
|
83 |
the X-axis <A href="exframes/frame_example3.2.2.html" target="blank">
|
|
|
84 |
[src]</A>
|
|
|
85 |
<P></P>
|
|
|
86 |
</DIV></P>
|
|
|
87 |
<P></P>
|
|
|
88 |
<HR NOSHADE>
|
|
|
89 |
<A HREF="toc.html">Contents</A>
|
|
|
90 |
<A HREF="7195InvertingtheYaxis.html">Previous</A>
|
|
|
91 |
<A HREF="721Addingbandsofpatternandcolortographs.html">Next</A>
|
|
|
92 |
</BODY>
|
|
|
93 |
</HTML>
|