| 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="819Moreonscales.html">
|
|
|
8 |
<LINK REL="Next" HREF="8111Usingfilledgridlines.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="819Moreonscales.html">Previous</A>
|
|
|
26 |
<A HREF="8111Usingfilledgridlines.html">Next</A>
|
|
|
27 |
<HR NOSHADE>
|
|
|
28 |
<H3><A NAME="8_1_10">8.1.10 Adjusting the grid lines in the plot</A></H3>
|
|
|
29 |
<P> By default only the Y-axis have grid lines and then only on major
|
|
|
30 |
ticks, i.e. ticks which have a label. It is of course possible to
|
|
|
31 |
change this. Both the X , Y and Y2 can have grid lines. It is also
|
|
|
32 |
possible to let the gridlines also be drawn on the minor tick marks,
|
|
|
33 |
i.e. ticks without a label. Lets see how we can apply this to the graph
|
|
|
34 |
above.</P>
|
|
|
35 |
<P> The grid is modified by accessing the xgrid (or ygrid) component of
|
|
|
36 |
the graph. So to display minor grid lines for the Y graph we make the
|
|
|
37 |
call<DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB">
|
|
|
38 |
$graph</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">ygrid</FONT><FONT
|
|
|
39 |
color="#007700">-></FONT><FONT color="#0000BB">Show</FONT><FONT color="#007700">
|
|
|
40 |
(</FONT><FONT color="#0000BB">true</FONT><FONT color="#007700">,</FONT><FONT
|
|
|
41 |
color="#0000BB">true</FONT><FONT color="#007700">)</FONT><FONT color="#0000BB">
|
|
|
42 |
</FONT></FONT></CODE></DIV></P>
|
|
|
43 |
<P> The first parameter determines if the grid should be displayed at
|
|
|
44 |
all and the second parameter determines whether or not the minor grid
|
|
|
45 |
lines should be displayed.</P>
|
|
|
46 |
<P> If you also wanted the grid lines to be displayed for the Y2 axis
|
|
|
47 |
you would call<DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB">
|
|
|
48 |
$graph</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">
|
|
|
49 |
y2grid</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">Show</FONT><FONT
|
|
|
50 |
color="#007700">(</FONT><FONT color="#0000BB">true</FONT><FONT color="#007700">
|
|
|
51 |
,</FONT><FONT color="#0000BB">true</FONT><FONT color="#007700">)</FONT><FONT
|
|
|
52 |
color="#0000BB"></FONT></FONT></CODE></DIV></P>
|
|
|
53 |
<P><STRONG> Note.</STRONG> In general it is not a good idea to display
|
|
|
54 |
both the Y and Y2 grid lines since the resulting image becomes
|
|
|
55 |
difficult to read for a viewer.</P>
|
|
|
56 |
<P> We can also enable the X-grid lines with the call<DIV class="phpscript">
|
|
|
57 |
<CODE><FONT color="#000000"> <FONT color="#0000BB"> $graph</FONT><FONT color="#007700">
|
|
|
58 |
-></FONT><FONT color="#0000BB">xgrid</FONT><FONT color="#007700">-></FONT><FONT
|
|
|
59 |
color="#0000BB">Show</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">
|
|
|
60 |
true</FONT><FONT color="#007700">)</FONT><FONT color="#0000BB"></FONT></FONT>
|
|
|
61 |
</CODE></DIV></P>
|
|
|
62 |
<P></P>
|
|
|
63 |
<P> In the above line we will of course only just enable the major grid
|
|
|
64 |
lines.</P>
|
|
|
65 |
<P> To bring all this together we will display a graph with grid lines
|
|
|
66 |
for both Y and X axis enabled.<DIV class="example">
|
|
|
67 |
<BR> <A href="exframes/frame_example8.html" target="blank"><IMG border="0"
|
|
|
68 |
HEIGHT="200" src="img/example8.png" WIDTH="350"></A>
|
|
|
69 |
<BR><B>Figure 18:</B> Enabling major and minor gridlines for Y-axis and
|
|
|
70 |
major grid lines for the X-axis <A href="exframes/frame_example8.html" target="blank">
|
|
|
71 |
[src]</A>
|
|
|
72 |
<P></P>
|
|
|
73 |
</DIV></P>
|
|
|
74 |
<P><DIV class="note"><B>Note:</B> If you think the first value of the
|
|
|
75 |
Y-axis is to close to the first label of the X-axis you have the option
|
|
|
76 |
of either increasing the margin (with a call to <A href="../ref/Axis.html#_AXIS_SETLABELMARGIN">
|
|
|
77 |
SetLabelMargin()</A> ) or to hide the first label (with a call to <A href="../ref/Axis.html#_AXIS_HIDEFIRSTTICKLABEL">
|
|
|
78 |
HideFirstTickLabel()</A> )</DIV></P>
|
|
|
79 |
<HR NOSHADE>
|
|
|
80 |
<A HREF="toc.html">Contents</A>
|
|
|
81 |
<A HREF="819Moreonscales.html">Previous</A>
|
|
|
82 |
<A HREF="8111Usingfilledgridlines.html">Next</A>
|
|
|
83 |
</BODY>
|
|
|
84 |
</HTML>
|