1
$\begingroup$

I was trying to plot a vertical line using ListPlot everything works perfectly:

MassPeaks = {{9.1, 0}, {9.1, 2}};
ListPlot[MassPeaks, Joined -> True]

However, if I change ListPlot to ListLogPlot my line disappears:

ListLogPlot[MassPeaks, Joined -> True]

shows the same axes but no line. Is this a bug or I am missing something?

$\endgroup$

1 Answer 1

3
$\begingroup$

Since Log[0] evaluates to Infinity you need a value close to 0. You also should specify PlotRange to get a "nice" scaling.

ListLogPlot[{{9.1, 2}, {9.1, 0.00001}},
 Joined -> True,
 PlotRange -> {Automatic, {0.1, 4}}]

enter image description here

Another possibility:

ListLogPlot[{{9.1, 2}}, Filling -> Bottom]

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.