| 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="717Usingthestepstyletorenderlineplots.html">
|
|
|
8 |
<LINK REL="Next" HREF="719Moreonscales.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="717Usingthestepstyletorenderlineplots.html">Previous</A>
|
|
|
26 |
<A HREF="719Moreonscales.html">Next</A>
|
|
|
27 |
<HR NOSHADE>
|
|
|
28 |
<H3><A NAME="7_1_8">7.1.8 Using logarithmic scale</A></H3>
|
|
|
29 |
<P> Using a logarithmic scale requires you to include the logarithmic
|
|
|
30 |
add on module in "jpgraph_log.php". So you must have the line<DIV class="phpscript">
|
|
|
31 |
<CODE><FONT color="#000000"> <FONT color="#0000BB"> </FONT><FONT color="#007700">
|
|
|
32 |
include(</FONT><FONT color="#DD0000">"jpgraph_log.php"</FONT><FONT color="#007700">
|
|
|
33 |
);</FONT><FONT color="#0000BB"></FONT></FONT></CODE></DIV></P>
|
|
|
34 |
<P>on the top of your code. To Illustrate how to use a logarithmic scale
|
|
|
35 |
let's make the right Y scale in the previous example a logarithmic
|
|
|
36 |
scale. This is done by the line<DIV class="phpscript"><CODE><FONT color="#000000">
|
|
|
37 |
<FONT color="#0000BB"> $graph</FONT><FONT color="#007700">-></FONT><FONT
|
|
|
38 |
color="#0000BB">SetY2Scale</FONT><FONT color="#007700">(</FONT><FONT color="#DD0000">
|
|
|
39 |
"log"</FONT><FONT color="#007700">);</FONT><FONT color="#0000BB"></FONT></FONT>
|
|
|
40 |
</CODE></DIV></P>
|
|
|
41 |
<P>This will then give the following result<DIV class="example">
|
|
|
42 |
<BR> <A href="exframes/frame_example7.html" target="blank"><IMG border="0"
|
|
|
43 |
HEIGHT="200" src="img/img/img/img/img/img/example7.png" WIDTH="350"></A>
|
|
|
44 |
<BR><B>Figure 17:</B> Using a logarithmic scale for both the Y2 axis <A href="exframes/frame_example7.html"
|
|
|
45 |
target="blank">[src]</A>
|
|
|
46 |
<P></P>
|
|
|
47 |
</DIV></P>
|
|
|
48 |
<P></P>
|
|
|
49 |
<P> You can of course also use a logarithmic X-scale as well. The
|
|
|
50 |
following example shows this.<DIV class="example">
|
|
|
51 |
<BR> <A href="exframes/frame_loglogex1.html" target="blank"><IMG border="0"
|
|
|
52 |
HEIGHT="300" src="img/img/img/img/img/img/loglogex1.png" WIDTH="500"></A>
|
|
|
53 |
<BR><B>Figure 18:</B> Example of using log scale on both X and Y axis
|
|
|
54 |
together with a linear Y2 scale <A href="exframes/frame_loglogex1.html" target="blank">
|
|
|
55 |
[src]</A>
|
|
|
56 |
<P></P>
|
|
|
57 |
</DIV></P>
|
|
|
58 |
<P> Even though we have so far only shown line graphs logarithmic scale
|
|
|
59 |
can also be used for bar, error, scatter plots as well. Even radar
|
|
|
60 |
plots supports the use of logarithmic plots. The following example
|
|
|
61 |
shows how to use a logarithmic scale for a bar graph.</P>
|
|
|
62 |
<P><DIV class="example">
|
|
|
63 |
<BR> <A href="exframes/frame_logbarex1.html" target="blank"><IMG border="0"
|
|
|
64 |
HEIGHT="220" src="img/img/img/img/img/img/logbarex1.png" WIDTH="400"></A>
|
|
|
65 |
<BR><B>Figure 19:</B> Example of using logarithmic scale togther with
|
|
|
66 |
bar plots <A href="exframes/frame_logbarex1.html" target="blank">[src]</A>
|
|
|
67 |
|
|
|
68 |
<P></P>
|
|
|
69 |
</DIV></P>
|
|
|
70 |
<P></P>
|
|
|
71 |
<HR NOSHADE>
|
|
|
72 |
<A HREF="toc.html">Contents</A>
|
|
|
73 |
<A HREF="717Usingthestepstyletorenderlineplots.html">Previous</A>
|
|
|
74 |
<A HREF="719Moreonscales.html">Next</A>
|
|
|
75 |
</BODY>
|
|
|
76 |
</HTML>
|