1
$\begingroup$

I have data in the form

 d={{x1,y1,dy1},{x2,y2,dy2},..{xn,yn,dyn}}; 

so the error bars are different for each coordinate pair. I want to plot on a logarithmic x-scale. Since I use Mathematica 9 the old library from Mathematica 6 with Errorlogplot does not seem to work. Kind regards Benjamin

$\endgroup$
1
  • $\begingroup$ Although the question asked specifically about version 9, in version 12, there's a better alternative as shown in this answer. $\endgroup$
    – balping
    Commented Apr 18, 2019 at 3:11

1 Answer 1

4
$\begingroup$

Try the ErrorBarLogPlots package, which you can download here:

Throw it in the folder that opens after evaluating this:

SystemOpen@FileNameJoin[{$UserBaseDirectory, "Applications"}]

Then load the package in Mathematica and go:

<< ErrorBarLogPlots`

ErrorListLogLogPlot[{{1, 2, 2}, {2, 3, 1}, {4, 4, 2.6}, {9.5, 12, 5}},
  Frame -> True, PlotRangePadding -> 0.1]

Mathematica graphics

Other plots available in this package are:

  • ErrorListLogLinearPlot
  • ErrorListLogPlot
$\endgroup$
7
  • $\begingroup$ I downloaded it here library.wolfram.com/infocenter/MathSource/6747 and did as you said. When I evaluate the notebook it says installation failed! Does not seem to work with Mathematica 9 + Windows 8 ( probably has nothing to do with windows 8). $\endgroup$
    – neverender
    Commented Jun 4, 2014 at 17:59
  • $\begingroup$ @neverender What do you mean by evaluate the notebook? Did you do anything other than using Get (<<)? I do have Mathematica 9 be it on Win7. $\endgroup$ Commented Jun 4, 2014 at 18:07
  • $\begingroup$ had to give the the installer file administrative rights, my bad. thank you very much! $\endgroup$
    – neverender
    Commented Jun 4, 2014 at 18:16
  • $\begingroup$ @neverender Just moving the .m file from the .zip file to the directory described above would have been sufficient. I should have described that better. $\endgroup$ Commented Jun 4, 2014 at 18:26
  • 3
    $\begingroup$ Note, however, that the error bars produced by ErrorListLogLogPlot are symmetric, which (at least in my opinion) is unexpected on a logarithmic scale. If this aspect is of importance, the error bars could always be constructed manually, e.g. by (ab)using ErrorListPlot: dat={{1,2,1},{2,3,1},{4,4,2.6},{9.5,12,5}} ListLogLogPlot[ dat[[All, 1 ;; 2]], Prolog -> ErrorListPlot[ With[{x = Log[#1], y = Log[#2]}, {{x, y}, ErrorBar[{Log[#2 - #3] - y, Log[#2 + #3] - y}]}] & @@@ dat, PlotRange -> All, Axes -> False][[1]], PlotRange -> {{0.5, 10}, {0.5, 50}} ] $\endgroup$
    – dakta
    Commented Jun 4, 2014 at 20:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.