MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: coordinates in LogLogPlots

  • To: mathgroup at smc.vnet.net
  • Subject: [mg112149] Re: coordinates in LogLogPlots
  • From: "David Park" <djmpark at comcast.net>
  • Date: Thu, 2 Sep 2010 02:31:22 -0400 (EDT)

Alessandro,

The main confusion arises because the underlying plot coordinates are in
natural Log, but the tick labeling is in Log base 10.

Here is a plot done using Presentations. It wasn't clear to me where you
actually wanted the Disk so I just put it near the curve and near the
center. I used a number formatting routine for simple labels on the x ticks.
In CustomTicks and CustomGridLines we have to specify the transformation
from label values to the underlying coordinates.

Needs["Presentations`Master`"] 

nformat[n_] :=
 Which[
  1 <= n < 10^2, n,
  10^-2 < n < 1, N[n],
  True, Superscript[10, Log[10, n]]] 

xticks = CustomTicks[Log, {1, 6, {1}, Range[2, 9]}, 
   CTNumberFunction -> nformat];
yticks = CustomTicks[Log, {0, 2, {1, 2, 5}, {3, 4, 6, 7, 8, 9}}];
xgrid = CustomGridLines[Log, {1, 6, Range[9]}, {LightGray}];
ygrid = CustomGridLines[Log, {0, 2, Range[9]}, {LightGray}];
Draw2D[
 {LogLogDraw[700/x^0.4`, {x, 100, 10^6}],
  {Orange,
   Disk[Log[{1000, 10}], Scaled[0.05]]},
  Text[Style["Curve", 14, Bold], Log[{10^4, 20}], {-1, 0}],
  Text[Style["Disk", 14, Bold], Log[{2000, 8}], {-1, 0}]},
 AspectRatio -> 1,
 PlotRange -> {Log[{10, 10^6}], Log[{1, 100}]},
 Frame -> True,
 FrameTicks -> {{yticks, yticks // NoTickLabels}, {xticks, 
    xticks // NoTickLabels}},
 GridLines -> {xgrid, ygrid}] 

It is generally better to directly label objects in a graphic, if you can,
but here is a legend version of the graphic if you want that.

xticks = CustomTicks[Log, {1, 6, {1}, Range[2, 9]}, 
   CTNumberFunction -> nformat];
yticks = CustomTicks[Log, {0, 2, {1, 2, 5}, {3, 4, 6, 7, 8, 9}}];
xgrid = CustomGridLines[Log, {1, 6, Range[9]}, {LightGray}];
ygrid = CustomGridLines[Log, {0, 2, Range[9]}, {LightGray}];
ShowLegend[
 Draw2D[
  {LogLogDraw[700/x^0.4`, {x, 100, 10^6}],
   {Orange,
    Disk[Log[{1000, 10}], Scaled[0.05]]},
   Text[Style["Curve", 14, Bold], Log[{10^4, 20}], {-1, 0}],
   Text[Style["Disk", 14, Bold], Log[{2000, 8}], {-1, 0}]},
  AspectRatio -> 1,
  PlotRange -> {Log[{10, 10^6}], Log[{1, 100}]},
  Frame -> True,
  FrameTicks -> {{yticks, yticks // NoTickLabels}, {xticks, 
     xticks // NoTickLabels}},
  GridLines -> {xgrid, ygrid}],
 {{{Graphics[{Black, Thick, Line[{{0, 0}, {3, 0}}]}], "The Curve"}},
  LegendPosition -> {-.8, -.8},
  LegendSize -> {0.7, 0.2},
  LegendTextOffset -> {-0.4, 0},
  LegendSpacing -> 0.6}] 

The Presentations application has tutorials on making custom log plots, and
also on using, and not using, legends.


David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/  

 

From: Alessandro [mailto:alexxx.magni at gmail.com] 

my fault without doubt, I keep on banging my head against the surreal
coordinate usage in Mathematica.

Currently I am trying to place a Disk[] in the Epilog section of a
LogLogPlot - using as disk coordinates the plot coordinates - and I
see that it doesnt work, I dont know why.

Show[LogLogPlot[700*x^-0.4, {x, 100, 10^6}, Frame -> True,  PlotRange -
> {{10, 10^6}, {1, 100}},
 Epilog -> {Disk[{3,4.2},0.1]}]

Since it seems to me that also the Legend system is broken in Log
plots, do you know if this is also true in this case?

thanks!

alessandro




  • Prev by Date: Difficulties with LocatorPanel
  • Next by Date: Re: Weighted graphs with sum of weights determining vertex placement?
  • Previous by thread: Re: coordinates in LogLogPlots
  • Next by thread: Re: coordinates in LogLogPlots