Blame | Letzte Änderung | Log anzeigen | RSS feed
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-iso-8859-1"><LINK REL="Start" HREF="index.html"><LINK REL="Contents" HREF="toc.html"><LINK REL="Prev" HREF="819Moreonscales.html"><LINK REL="Next" HREF="8111Usingfilledgridlines.html"><STYLE TYPE="text/css"><!--BODY { font-family: serif }H1 { font-family: sans-serif }H2 { font-family: sans-serif }H3 { font-family: sans-serif }H4 { font-family: sans-serif }H5 { font-family: sans-serif }H6 { font-family: sans-serif }SUB { font-size: smaller }SUP { font-size: smaller }PRE { font-family: monospace }A { text-decoration: none }--></STYLE></HEAD><BODY><A HREF="toc.html">Contents</A><A HREF="819Moreonscales.html">Previous</A><A HREF="8111Usingfilledgridlines.html">Next</A><HR NOSHADE><H3><A NAME="8_1_10">8.1.10 Adjusting the grid lines in the plot</A></H3><P> By default only the Y-axis have grid lines and then only on majorticks, i.e. ticks which have a label. It is of course possible tochange this. Both the X , Y and Y2 can have grid lines. It is alsopossible to let the gridlines also be drawn on the minor tick marks,i.e. ticks without a label. Lets see how we can apply this to the graphabove.</P><P> The grid is modified by accessing the xgrid (or ygrid) component ofthe graph. So to display minor grid lines for the Y graph we make thecall<DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB"> $graph</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">ygrid</FONT><FONTcolor="#007700">-></FONT><FONT color="#0000BB">Show</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">true</FONT><FONT color="#007700">,</FONT><FONTcolor="#0000BB">true</FONT><FONT color="#007700">)</FONT><FONT color="#0000BB"></FONT></FONT></CODE></DIV></P><P> The first parameter determines if the grid should be displayed atall and the second parameter determines whether or not the minor gridlines should be displayed.</P><P> If you also wanted the grid lines to be displayed for the Y2 axisyou would call<DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB"> $graph</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">y2grid</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">Show</FONT><FONTcolor="#007700">(</FONT><FONT color="#0000BB">true</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">true</FONT><FONT color="#007700">)</FONT><FONTcolor="#0000BB"></FONT></FONT></CODE></DIV></P><P><STRONG> Note.</STRONG> In general it is not a good idea to displayboth the Y and Y2 grid lines since the resulting image becomesdifficult to read for a viewer.</P><P> We can also enable the X-grid lines with the call<DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB"> $graph</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">xgrid</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">Show</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">true</FONT><FONT color="#007700">)</FONT><FONT color="#0000BB"></FONT></FONT></CODE></DIV></P><P></P><P> In the above line we will of course only just enable the major gridlines.</P><P> To bring all this together we will display a graph with grid linesfor both Y and X axis enabled.<DIV class="example"><BR> <A href="exframes/frame_example8.html" target="blank"><IMG border="0"HEIGHT="200" src="img/example8.png" WIDTH="350"></A><BR><B>Figure 18:</B> Enabling major and minor gridlines for Y-axis andmajor grid lines for the X-axis <A href="exframes/frame_example8.html" target="blank">[src]</A> <P></P></DIV></P><P><DIV class="note"><B>Note:</B> If you think the first value of theY-axis is to close to the first label of the X-axis you have the optionof either increasing the margin (with a call to <A href="../ref/Axis.html#_AXIS_SETLABELMARGIN">SetLabelMargin()</A> ) or to hide the first label (with a call to <A href="../ref/Axis.html#_AXIS_HIDEFIRSTTICKLABEL">HideFirstTickLabel()</A> )</DIV></P><HR NOSHADE><A HREF="toc.html">Contents</A><A HREF="819Moreonscales.html">Previous</A><A HREF="8111Usingfilledgridlines.html">Next</A></BODY></HTML>