2
$\begingroup$

I browsed the different ListLinePlot questions and bug posts, but couldn't find one addressing this problem - it's possible I missed it though. Here's hoping it has a simple answer!

I'm using Mathematica 8 because that's what's installed on the cluster I work on (I can't ask them to upgrade it), and when plotting using ListLinePlot, I've noticed that my data inevitably gets cut off in the y-direction, where it is fully plotted using just ListPlot. It's a lot easier to see the trends I need to check using ListLinePlot, though, so this is a bit of a problem.

Here's an image showing said cut off, I changed the y-axis manually and plotted using both ListPlot and ListLinePlot just to confirm that yes, it's actually not plotting that top part at all using ListLinePlot.

]

Any suggestions on how to get around this?

$\endgroup$
3
  • 3
    $\begingroup$ Put PlotRange -> All inside both the ListPlot and ListLinePlot commands, and see if that fixes it. $\endgroup$
    – march
    Sep 26, 2017 at 18:39
  • 3
    $\begingroup$ fyi you do not need to overlay plots to get a lines-with-markers. Use ListLinePlot[..., PlotMarkers -> Automatic] or ListPlot[...,Joined->True, PlotMarkers -> Automatic] $\endgroup$
    – george2079
    Sep 26, 2017 at 19:18
  • $\begingroup$ @march, that did indeed fix it - why does PlotRange outside the ListLinePlot chop the y-axis range as opposed to inside? $\endgroup$
    – Andrearwen
    Sep 27, 2017 at 18:59

1 Answer 1

1
$\begingroup$

@march kindly supplied the answer, that placing PlotRange->All inside the ListLinePlot command would fix the problem. I'm still not sure why, but I'll take it!

(Also, thank you to @george2079 for his information about adding plot markers, I wasn't aware of those, and they will be useful at a later time.)

$\endgroup$
3
  • $\begingroup$ With the PlotRange outside the Plots do their own autoranging independently. Show's PlotRange takes affect only after the plots have been generated. You should probalbly see whats happening if you look at the ListLinePlot by itself. Why ListPlot and ListLinePlot decided on different ranges for the same data is a good question. $\endgroup$
    – george2079
    Sep 29, 2017 at 18:34
  • $\begingroup$ George, that's what I had done originally - which is why I'm confused. I only added the ListPlot to illustrate that ListLinePlot was in fact cutting off my data. When I plotted ListLinePlot on its own with PlotRange->All outside the brackets ( Show[ListLinePlot[afpeaks], PlotRange->All] ), it still cut it off. $\endgroup$
    – Andrearwen
    Sep 30, 2017 at 19:12
  • 1
    $\begingroup$ right, the PlotRange option to Show does not "trickle down" to ListLinePlot. The plot is generated using whatever heuristic ListLinePlot uses for auto ranging (pretty poor choice in this case), then Show expands the range, but by then the data is cut off. $\endgroup$
    – george2079
    Oct 1, 2017 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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