10
$\begingroup$

One way to plot a sequence of numbers on a logarithmic number line is this:

LogLogPlot[0, {t, 8, 16}, Axes -> {True, False}, Ticks -> {{8, 9, 10, 11, 12, 13, 14, 15, 16}}] 

logarithmic number line values 8 to 16

How can the line be bent into a circle, or how can these values be plotted on a circle?

logarithmic values 8 to 16 on circle

The ParametricPlot function plots a circle around the coordinates when using [{Sin[2 u], Cos[2 u]}, {u, 0, 2 Pi}] and Graphics[Circle[]] draws a circle but I can't figure out how to put Ticks on them.

$\endgroup$

4 Answers 4

5
$\begingroup$

Approach with build-in PolarTicks:

PolarPlot[, {x, 0, 1}, PolarAxes -> Automatic, PolarTicks -> Transpose@{π/2 - 2 π Rescale@Log[#], Join[{""}, #[[2 ;; -2]], {ToString@#[[-1]] <> "/" <> ToString@#[[1]]}]}] &@ Range[8, 16] 

enter image description here

$\endgroup$
1
  • $\begingroup$ Ah, nice that you could use PolarTicks. I've usually found it easier to herd cats than to get PolarTicks to behave the way I want... $\endgroup$ Commented Oct 13, 2013 at 22:38
12
$\begingroup$
set = {8, 9, 10, 11, 12, 13, 14, 15, 16}; logset = Log[set]; resc = 2 Pi Rescale[logset]; f[u_] := {Sin[u], Cos[u]}; markers = Line[{f[#], 1.1 f[#]}] & /@ resc; labels = MapThread[ Text[#1, 1.2 f[#2]] &, {set /. {8 -> "16/8", 16 -> ""}, resc}]; Graphics[{Circle[], markers, labels}] 

enter image description here

$\endgroup$
0
5
$\begingroup$

It's probably best to ditch ParametricPlot and the like and build your own number line using graphics primitives. The following is my implementation (the code should be pretty easy to follow):

Clear@logCircle logCircle[pts_] := With[ { θ = 360 Accumulate@Normalize[Differences[Log@pts], Total], coord = {Sin[# Degree], Cos[# Degree]} & }, Graphics[{ Circle[], MapThread[ Text[ If[# == Last@pts, # ~~ "/" ~~ First@pts, #] /. n_?NumericQ :> ToString@n, 1.1 coord@#2 ] &, {Rest@pts, θ} ], Map[Line[{coord@#, 1.05 coord@#}] &, θ] }] ] logCircle[Range[8, 16]] 

$\endgroup$
2
  • $\begingroup$ How would your code look using Rescale@logset instead of Accumulate@Normalize[Differences[Log@pts]? $\endgroup$ Commented Oct 13, 2013 at 10:58
  • 1
    $\begingroup$ @Bogdan Replace Accumulate@Normalize[...] with Rest@Rescale@Log@pts. Rest of it remains the same, and you can use it with any set of ticks. $\endgroup$ Commented Oct 13, 2013 at 14:43
1
$\begingroup$

(Third version) Here is the code as a function. numlist need not be a Range.

circlog[numlist_] := Block[{a,b}, {a,b} = numlist[[{1,-1}]]; Show[Graphics@{ Circle[{0,0},1], {Text[If[# == a, SequenceForm[b,"/",a], #], 1.1 #2], Line@{#2, 1.04 #2}}& @@@ ({#, Through[{Sin,Cos}[2Pi*Log[b/a,#/a]]]}& /@ Most@numlist) }, AspectRatio->Automatic]]; circlog@Range[8,16] 

enter image description here

$\endgroup$
4
  • $\begingroup$ There's an extra ; at the end of the code. The reason I didn't use Range is that this should work with any sequence of numbers; values 8 to 16 were easy to exemplify in a drawing. How would the code change when using {8, 9, 10, 11, 12, 13, 14, 15, 16}? $\endgroup$ Commented Oct 13, 2013 at 11:06
  • $\begingroup$ The ; at the end suppresses the unwanted - Graphics - message that 5.2 prints. I've updated the code to handle non-Range lists. $\endgroup$ Commented Oct 14, 2013 at 8:21
  • $\begingroup$ There's a & missing before the @@@. Now all I have to do is add another line and write circlog[{8, 9, 10, 11, 12, 13, 14, 15, 16}] $\endgroup$ Commented Oct 14, 2013 at 10:04
  • $\begingroup$ Done, as requested. $\endgroup$ Commented Oct 14, 2013 at 15:57

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.