1
$\begingroup$

I've been trying to print information on the axes of a graphic. I'm doing that by the option FrameLabel in the ErrorListPlot function. But it failed.

Here the code I'm using

Needs["ErrorBarPlots`"];

d    = Import["teste.txt", "TSV"];
dNew = Table[{{d[[i, 1]], d[[i, 2]]}, ErrorBar[d[[i, 3]]]}, {i, 2, Length[d]}];

ErrorListPlot[dNew, FrameLabel -> {"Position, x (inches)", "Photodetector output (V)"}]

The result

enter image description here

How can I fix it?

Thanks for the attention.

Hellon

$\endgroup$
1
  • $\begingroup$ Is there a way of plot the "Position, x (inches)" below the x axis and the "Photedector output(V)" next to y? – Hellon Canella Machado $\endgroup$ Commented Sep 2, 2014 at 14:18

2 Answers 2

1
$\begingroup$

In ErrorListPlot, there is not such an option as "FrameLable", but "AxesLable", so use "AxesLable" instead of "FrameLable", just like this enter image description here

Another way to do that is using function "Show, like this:

 ErrorListPlot[Table[{i, RandomReal[0.5]}, {i, 10}]];
 Show[%, Frame -> {{True, False}, {True, False}}, 
 FrameLabel -> {"Position, x (inches)", "Photodetector output (V)"}]

enter image description here

I'm sorry that my poor English is very poor, so I can not give much explain

$\endgroup$
3
  • $\begingroup$ Is there a way of plot the "Position, x (inches)" below the x axis and the "Photedector output(V)" next to y? $\endgroup$ Commented Sep 2, 2014 at 14:14
  • $\begingroup$ Yes, I have edited the answer to show the way $\endgroup$
    – wuyingddg
    Commented Sep 2, 2014 at 14:25
  • $\begingroup$ Thank you guy. Your suggestions were very useful. Hellon $\endgroup$ Commented Sep 2, 2014 at 14:33
1
$\begingroup$

You need to add Frame -> True to specify FrameLabel:

Needs["ErrorBarPlots`"] 

ErrorListPlot[{
  {{1, 1}, ErrorBar[0.2]},
  {{2, 2}, ErrorBar[0.1]},
  {{3, 4}, ErrorBar[0.3]},
  {{4, 6}, ErrorBar[0.4]}}, 
 Frame -> True,
 FrameLabel -> {"Position, x (inches)", "Photodetector output (V)"   },
 GridLines -> Automatic,
 Joined -> True] 

enter image description here

$\endgroup$

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.