# Why does ErrorListPlot not work with predefined list?

I have the following list and try to plot it in an ErrorListPlot. The result of

ErrorListPlot[elp,
PlotRange -> {{0.9, 3.2}, {0, 35}}, Frame -> True, Axes -> False]


is an empty plot: With the direct usage of the values in the plot command:

ErrorListPlot[{{30., 5.2/Sqrt}, {29.3, 3.9/Sqrt},
{27.2, 8.2/Sqrt}},
PlotRange -> {{0.9, 3.2}, {0, 35}}, Frame -> True, Axes -> False]


I get the awaited result: Can anybody give me a hint, why it does not work with the list? In my application, the list is much longer and it would be very inconvenient to write the list directly into the command.

• what version of Mathematica are you using? I've checked on v9.0.2 and 8.0.1 and I can't reproduce this. – rcollyer Mar 16 '15 at 13:20
• Does elp == {{30., 5.2/Sqrt}, {29.3, 3.9/Sqrt}, {27.2, 8.2/Sqrt}} return True? – Karsten 7. Mar 17 '15 at 0:33
• @rcollyer I'm using Mathematica 10.0.2 – Lea Mar 17 '15 at 8:16
• @Karsten7. No, strangely enough not. It gives {{30., 5.2/Sqrt["462"]}, {29.3, 3.9/Sqrt["4"]}, {27.2, 8.2/Sqrt[ "80"]}} == {{30., 0.241926}, {29.3, 1.95}, {27.2, 0.916788}} – Lea Mar 17 '15 at 8:17
• If I'm using a step in between with test = {{30., 5.2/Sqrt}, {29.3, 3.9/Sqrt}, {27.2, 8.2/Sqrt}} and then ErrorListPlot[test, PlotRange -> {{0.9, 3.2}, {0, 35}}, Frame -> True, Axes -> False] it works. – Lea Mar 17 '15 at 8:22

You can find the reason why the plot is empty in one of your comments.

{{30., 5.2/Sqrt["462"]}, {29.3, 3.9/Sqrt["4"]}, {27.2, 8.2/Sqrt["80"]}}

The arguments for the Sqrt functions are stings of numbers, not numbers.
You can convert these strings to numbers using ToExpression:

elp = elp /. s_String :> ToExpression[s]


Now

ErrorListPlot[elp, PlotRange -> {{0.9, 3.2}, {0, 35}}, Frame -> True, Axes -> False]


should return the expected plot.

• On can use elp // InputForm to see if elp contains any string. – Karsten 7. Mar 17 '15 at 15:12
• Okay thank you very much, with the knowledge, that the Sqrt uses strings I can completely understand the problem. Do I find such information in the documentation? – Lea Mar 19 '15 at 12:31
• @Lea If the argument for Sqrt is a string, it'll not evaluate to a numerical value. Try Sqrt, Sqrt["4"], and Sqrt["test"]. This is part of the "everything can be represented as symbolic expression" Wolfram Language programming paradigm. – Karsten 7. Mar 19 '15 at 17:22

I guess it is because of the square symbol. Try

ErrorListPlot[elp//N ,PlotRange -> {{0.9, 3.2}, {0, 35}}, Frame -> True, Axes -> False]

• No, that is not the point. – Lea Mar 16 '15 at 12:32
• Sorry, maybe I was wrong and it could help, but elp//N does not work in my case – Lea Mar 17 '15 at 10:15