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?


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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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