0

I want to draw those data with ErrorBar and the Y-axis must be in Log scale

Derivative[1][HoldForm[Get["ErrorBarLogPlots"]]]
B = ErrorListLogPlot[{{{13.952, 364.7},ErrorBar[36.4]}, {{19.13, 309.11},ErrorBar[30.9]}, {{21, 294.159},ErrorBar[29.4]}, {{26.2635, 237.26},ErrorBar[23.7]}, {{29.0713, 191.367},ErrorBar[19.1]}, {{32.959, 151.82},ErrorBar[15.1]}, {{37.2786, 118.47},ErrorBar[11.8]}, {{42.246, 86.529},ErrorBar[8.6]}, {{46.1339, 67.5217},ErrorBar[6.7]}, {{48.9417, 39.7778},ErrorBar[3.9]}, {{52.6134, 32.0836}, ErrorBar[3.2]}, {{54.7732, 24.2215},ErrorBar[2.4]}, {{58.2289, 14.0352},ErrorBar[1.4]}, {{62.7646, 6.13975}, ErrorBar[0.6]}, PlotRange -> {{0, 130}, {10^-2, 10^3}}, Frame -> True,FrameLabel -> {"cm", "(mb)"},LabelStyle -> Directive[Bold, Medium],PlotLegends -> Placed[{"(Exp"}, {.7, .65}],PlotStyle -> Directive[Blue, Medium]]
MarcoB
  • 67,153
  • 18
  • 91
  • 189
Mfafa
  • 35
  • 4

2 Answers2

2

You should check out this OLD POST, but there were new developments in WL12 - function Around. So you do not need any packages anymore and can use regular plots and take advantage of such convenient options as ScalingFunctions. Format your data as:

data={{13.952, Around[364.7, 36.4]}, {19.13, Around[309.11, 30.9]}, 
{21, Around[294.159, 29.4]}, {26.2635, Around[237.26, 23.7]}, 
{29.0713, Around[191.367, 19.1]}, {32.959, Around[151.82, 15.1]}, 
{37.2786, Around[118.47, 11.8]}, {42.246, Around[86.529, 8.6]}, 
{46.1339, Around[67.5217, 6.7]}, {48.9417, Around[39.7778, 3.9]}, 
{52.6134, Around[32.0836, 3.2]}, {54.7732, Around[24.2215, 2.4]}, 
{58.2289, Around[14.0352, 1.4]}, {62.7646, Around[6.13975, 0.6]}};

that formats nicely as

enter image description here

Then simply use 2 options:

ListLogPlot[data, PlotTheme -> "Detailed"]

OR

ListPlot[data,ScalingFunctions->"Log",PlotTheme->"Detailed"]

which will give you same result:

enter image description here

Vitaliy Kaurov
  • 73,078
  • 9
  • 204
  • 355
1

Use Around instead of ErrorBar in the new version.

B = ErrorListLogPlot[{{{13.952, 364.7}, 
     ErrorBar[36.4]}, {{19.13, 309.11}, 
     ErrorBar[30.9]}, {{21, 294.159}, 
     ErrorBar[29.4]}, {{26.2635, 237.26}, 
     ErrorBar[23.7]}, {{29.0713, 191.367}, 
     ErrorBar[19.1]}, {{32.959, 151.82}, 
     ErrorBar[15.1]}, {{37.2786, 118.47}, 
     ErrorBar[11.8]}, {{42.246, 86.529}, 
     ErrorBar[8.6]}, {{46.1339, 67.5217}, 
     ErrorBar[6.7]}, {{48.9417, 39.7778}, 
     ErrorBar[3.9]}, {{52.6134, 32.0836}, 
     ErrorBar[3.2]}, {{54.7732, 24.2215}, 
     ErrorBar[2.4]}, {{58.2289, 14.0352}, 
     ErrorBar[1.4]}, {{62.7646, 6.13975}, ErrorBar[0.6]}, 
    PlotRange -> {{0, 130}, {10^-2, 10^3}}, Frame -> True, 
    FrameLabel -> {"cm", "(mb)"}, 
    LabelStyle -> Directive[Bold, Medium], 
    PlotLegends -> Placed[{"(Exp"}, {.7, .65}], 
    PlotStyle -> Directive[Blue, Medium]}] /. {{{x_, y_}, 
     ErrorBar[error_]} :> {x, Around[y, error]}, 
   ErrorListLogPlot -> ListLogPlot}

enter image description here

cvgmt
  • 72,231
  • 4
  • 75
  • 133