7. Graphs on Logarithmic and Semi-Logarithmic Paper

by M. Bourne

In a semilogarithmic graph, one axis has a logarithmic scale and the other axis has a linear scale. You can see some examples of semi-logarithmic graphs in this YouTube Traffic Rank graph and in this article on loudspeakers (external site). See also air pressure and Zipf Distributions later on this page.

Need Graph Paper?

rectangular grid
Download graph paper, including
log-log and semi-log.

In log-log graphs, both axes have a logarithmic scale.

The idea here is we use semilog or log-log graph paper so that we can more easily see details for small values of y as well as large values of y.



Semi-Logarithmic Graphs

Example 1: Variable Exponent

Plot the graph of y = 5x on normal and then semilogarithmic paper.

Answer:

We first graph y = 5x using ordinary x- and y- linear scales (the space between each unit remains fixed for both axes):

math expression

We see that the detail for anything less than x = 2 is lost.

Using a semilogarithmic scale on the y axis gives:

math expression

We can now see much more detail in the y values when x < 2.

Notice that the numbers along the x axis are evenly spaced, while along the y-axis, we have powers of 10 evenly spaced.

What does the scale mean on the y-axis? To see more clearly, let's zoom in on the section between 1 and 10:

math expression

Now let's zoom in on the section between 0.1 and 1.0.

math expression

Log-log Graphs

We can also graph y = 5x on log-log paper (i.e. both axes use log scales)

NOTE: Both the domain (x-values) and the range (y-values) must be POSITIVE, because you cannot have the logarithm of a negative number.

math expression

We can see even more detail for small values of x and y now.


Let's have a play. I have drawn an exponential curve for you in LiveMath. You can see what it looks like on a semilogarithmic scale; and on a log-log scale. Change the function to anything you like (within reason) and see what it looks like in semi-log and log-log format.

LIVEMath


Example 2: Variable Raised to a Fractional Exponent

Let's now graph y = x1/2 using all 3 axis types. This function is equivalent to y =x.

Using rectangular axes, we can see that the graph of y = x1/2 is half of a parabola on its side (i.e. its axis is vertical):

sqrt x

We have seen this curve before, in The Parabola section.

Note 1: The detail near (0, 0) is not so good using a rectangular grid.

Note 2: The curve passes through (0, 0), (1, 1), (4, 2) and (9, 3). In each case, the y-value is the square root of the x-value, which is to be expected.

Let's see the curve using a semi-logarithmic plot.

sqrt x semi-log

Now we have a lot better detail for small x. The lowest value of y that the graph indicates is y = 0.1. We cannot show y = 0, since the logarithm of 0 is not defined.

We can see that the curve still passes through (1, 1), (4, 2) and (9, 3).

And now for the log-log graph:

sqrt x log-log

We observe that the graph of y =x is a straight line when graphed on log-log axes.

Our curve passes through (1, 1), (4, 2) and (9, 3), as it should.

Application 1: Air pressure

1. By pumping, the air pressure in a tank is reduced by 18% each second. So the percentage of air pressure remaining is given by p = 100(0.82)t.

Plot p against t for 0 < t < 30 s on

(a) a rectangular co-ordinate system

(b) a semilogarithmic system.

Try it on paper first, and then see what you get using the LiveMath example above.

The answer is given below.

 

Answer:

(a) Rectangular plot:

math expression

(b) Semilogarithmic Plot:

math expression

Application 2: Zipf Distributions

Consider the most common words in English. It turns out that there is a relationship between the rank of a word's occurrence and the frequency of its use. That relationship was observed by George Kingsley Zipf in the first half of the 20th century.

The Zipf Distribution is an observation comparing rank and frequency of word occurrences. In general, the word with rank k has a frequency roughly proportional to 1/k. In other words, the second most commonly used word occurs about 1/2 as often as the most common word. Likewise, the 3rd most common word occurs about 1/3 as often as the most common word.

Zipf Distributions occur naturally in many situations, for example in:

a. Common English Words

Zipf originally developed his law in response to the observation that the frequency of words was inversely proportional to the rank of each word.

For example, the most common 20 words in English are listed in the following table. The table is based on the Brown Corpus, a careful study of a million words from a wide variety of sources including newspapers, books, magazines, fiction, government documents, comedy and academic publications.

The most common word, "the" occurred around 70,000 times (or 7% of the million words counted). The next ranked word, "of", occurred around 3.6% of the time (or about 1/2 as often as the top-ranked word.) The third most popular word was "and", with a frequency of 2.8%, or roughly 1/3 of the frequency of the top ranked word.

Rank Word Frequency % Frequency Theoretical Zipf
Distribution
1 the 69970 6.8872 69970
2 of 36410 3.5839 36470
3 and 28854 2.8401 24912
4 to 26154 2.5744 19009
5 a 23363 2.2996 15412
6 in 21345 2.1010 12985
7 that 10594 1.0428 11233
8 is 10102 0.9943 9908
9 was 9815 0.9661 8870
10 he 9542 0.9392 8033
11 for 9489 0.9340 7345
12 it 8760 0.8623 6768
13 with 7290 0.7176 6277
14 as 7251 0.7137 5855
15 his 6996 0.6886 5487
16 on 6742 0.6636 5164
17 be 6376 0.6276 4878
18 at 5377 0.5293 4623
19 by 5307 0.5224 4394
20 I 5180 0.5099 4187

(The first 20 words in the Brown Corpus, published in 1967. This Corpus is the count of how often one million words were used in a variety of books, newspapers and other publications. Table source.

I have included the "Theoretical Zipf Distribution, based on the n-th ranked word occurring approximately 1/n times the frequency of the highest ranked word. This gives us a hyperbola, that we met before.)

Let's plot what we have observed:

brown corpus

The dark blue data points represent the top 20 occurring English words (with the first few labeled). The pink line is the theoretical Zipf distribution, which is found to be f/(n0.94), where f is the frequency of the top-ranked word and n is the rank of the word.

f/(10.94) = 69970,
f/20.94 = 69970/20.94 = 36470,
f/30.94 = 69970/30.94 = 24912,
f/40.94 = 69970/40.94 = 19009,
f/50.94 = 69970/50.94 = 15412,
...

The power 0.94 comes from observing the best line of fit for the word frequencies.

There is a fairly large gap in the pattern for the words "to", "a" and "in", but it settles down and is quite consistent after that.

We now plot the top 2000 English words and use a log-log scale (log of the rank for the horizontal axis and log of the frequency for the vertical axis). If a distribution gives us a straight line on a log-log scale, then we can say that it is a Zipf Distribution.

brown corpus log-log

We see that there is a remarkably consistent result for the top 2000 most-used English words. For your information, the last few in the list of 2000 words are:

1992nddevice
1993rd conduct
1994th runs
1995th improved
1996th games
1997th cultural
1998th plenty
1999th mile
2000th components

b. Websites and the Zipf Distribution

We also observe a Zipf Distribution when it comes to popularity of pages in Websites.

For example, out of the most recent 500,000 page views in Interactive Mathematics, the most commonly visited page is the homepage, with 27,855 views. The next most common page is the Algebra Introduction, with around 1/2 of the views. The 3rd ranked page has about 1/3 of the views of the most popular page.

Rank Page Frequency
(Page views)
1 Home 27855
2 Basic Algebra Introduction 15334
3 Addition & Subtraction in Algebra 7605
4 Math Of Beauty 5965
5 Graphs of Sine and Cosine 5749
6 Volume of Solid of Revolution 5667
7 Trigonometric Graphs Introduction 5584
8 Download LiveMath 5517
9 Introduction to Trigonometric Functions 4701
10 Sitemap 4309

For the top 500 pages in the site, we have the following log-log graph of the page views:

intmath - zipf distribution

The theoretical Zipf Distribution (the pink line) is obtained as follows. The power used, 0.67, once again comes from observing the best line of fit.

27855/20.67 = 17,507
27855/30.67 = 13,342
27855/40.67 = 11,003
27855/50.67 = 9,475
27855/60.67 = 8,835

After the page ranked 200th, the pattern breaks down, but interestingly, from the 300th to the 500th page, there is still a consistent relationship between rank and frequency.

See also Zipf Distributions, log-log graphs and Site Statistics over in the math blog.

 



Didn't find what you are looking for on this page? Try search:

The IntMath Newsletter

Sign up for the free IntMath Newsletter. Get math study tips, information, news and updates each fortnight. Join thousands of satisfied students, teachers and parents!

Given name: * required

Family name:

email: * required

See the Interactive Mathematics spam guarantee.

Math Lessons on DVD

get MathTutorDVDs

Easy to understand math lessons on DVD. See samples before you commit.

More info: Math videos

 

Bookmark this page

Add this page to diigo, Redditt, etc.

 

 


Need a break? Play a math game. Well, they all involve math... No, really!

dumbolf memoTST bola shadow factory mindfields trick-hoops-challenge crystal clear