Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Topic: Incorrectly Cropped ListPlot
Replies: 2   Last Post: Sep 12, 2013 11:15 PM

 Messages: [ Previous | Next ]
 David Park Posts: 1,560 Registered: 5/19/07
Re: Incorrectly Cropped ListPlot
Posted: Sep 12, 2013 2:15 AM

Themis,

Basically you have to also put a PlotRange into the ListPlot statement. I'm
not certain why you are trying to combine two plots in this manner. Why not
just make a single plot? In any case PlotRange is an option that does double
duty. It determines which range will be used in retaining plot points in a
curve, and it also determines the overall plot ranges for display. (This
distinction also comes into play in ContourPlot and DensityPlot where the
display is only 2D but a z PlotRange is necessary to specify which contours
or values will be retained in the plot.) This gets confused when you are
combining plots.

With Presentations I would do it this way:

<< Presentations`

Draw2D[
{(* possible other curves maybe with a PlotRange *)
ListDraw[Evaluate[f], Filling -> Axis, Joined -> True,
PlotRange -> All]},
AspectRatio -> 1/GoldenRatio, Axes -> True,
ImageSize -> Medium, PlotRange -> {{0, Length[f]}, {0, 0.1}},
FrameLabel -> {"X", "Y"}]

The PlotRange in ListDraw determines what y range of points is to be
accepted for that curve and the PlotRange at the end determines the ranges
used in the displayed graphic. If you are going to use Show you could put
the first PlotRange in the ListPlot, and the second PlotRange in the Show
statement.

David Park
djmpark@comcast.net
http://home.comcast.net/~djmpark/index.html

From: Themis Matsoukas [mailto:tmatsoukas@me.com]

In the ListPlot below, the graph is unexpectedly cropped. Do others confirm
this? Is there a cure?

I apologize for the long data set (166 points) but this problem does not not
normally appear with other data sets.

(v9.01, Mac OS 10.8.4)

f = {28.1792365971891`, 3.5982872799476424`, 1.0378983682569967`,
0.4632719164938047`, 0.21685764678476743`, 0.10593018225382422`,
0.06130960964625232`, 0.05244650523022995`, 0.03653950681649269`,
0.027787329865001275`, 0.019062884779642592`,
0.021808339526783436`, 0.009390009872544344`, 0.00662236963249731`,
0.009561947442567305`, 0.00849704378307025`,
0.010621304728837813`, 0.008186446882383609`,
0.0048197983338694825`, 0.015407824823348014`,
0.0031891646052646175`, 0.0007154821462245838`,
0.005257961818766708`, 0.01064903659497055`, 0.004021120589246692`,
0.0024681360858134866`, 0.005856970127233802`,
0.0007820386249431496`, 0.0005879155620139991`,
0.004742149108697823`, 0.0026012490432506183`,
0.002623434536156807`, 0.0022961985157905246`,
0.0020077871080100723`, 0.0047587882283774635`,
0.004126501680551088`, 0.004653407137073068`,
5.5463732265471604`*^-6, 0.00021630855583533928`, 0.`, 0.`,
0.0017138293270030727`, 0.00359404985080256`, 0.00404330608215288`,
0.`, 0.`, 0.`, 0.`, 0.0005823691887874519`,
0.0024071259803214676`, 0.`, 0.`, 0.002274013022884336`, 0.`,
0.0011480992578952623`, 0.`, 0.`, 0.`, 0.0003272360203662825`, 0.`,
0.0016805510876437898`, 0.00009428834485130173`, 0.`, 0.`,
0.0024681360858134866`, 0.001031625420137772`,
0.0014254179192226203`, 0.006239669879865556`, 0.`, 0.`,
0.0018413959112136575`, 0.0013921396798633374`,
0.011980166169341867`, 0.`, 0.0048197983338694825`, 0.`, 0.`,
0.0003826997526317541`, 0.`, 0.`, 0.00009428834485130173`, 0.`,
0.0044925623135032`, 0.002939577810069995`, 0.010981818988563378`,
0.`, 0.008186446882383609`, 0.`, 0.`, 0.0004104316187644899`, 0.`,
0.0003272360203662825`, 0.0020466117205959022`,
0.00039379249908484844`, 0.`, 0.`, 0.0030615980210540327`, 0.`,
0.0024681360858134866`, 0.001137006511442168`,
0.00017193757002296198`, 0.`, 0.`, 0.0002606795416477166`, 0.`,
0.`, 0.`, 0.007476511109385573`, 0.`, 0.`, 0.0013311295743713186`,
0.`, 0.`, 0.0028730213313514293`, 0.`, 0.`, 0.002318384008696713`,
0.`, 0.00023294767551498076`, 0.0011536456311218093`, 0.`,
0.0015696236231128465`, 0.007687273291994365`,
0.0015252526373004693`, 0.`, 0.011946887929982584`,
0.008031148432040289`, 0.`, 0.0008042241178493383`,
0.0021908174244861284`, 0.004021120589246692`,
0.013422223208244129`, 0.001724922073456167`,
0.0004381634848972257`, 0.002723269254234656`,
0.006073278683069141`, 0.011508724445085359`,
0.0005379982029750746`, 0.0006156474281467348`,
0.0013810469334102431`, 0.00584033100755416`, 0.`,
0.006960698399316687`, 0.`, 0.01813109407758267`,
0.020599230163396154`, 0.03043294989406427`, 0.027315888140744767`,
0.04342810236386427`, 0.0009484298217395645`,
0.03459827618720119`, 0.011747218493826886`, 0.018508247456987877`,
0.0733618786675393`, 0.03374413471031293`, 0.08204749914031215`,
0.06322865478263763`, 0.15423354668382344`, 0.06886376998080955`,
0.019229275976439007`, 0.07850336664854851`, 0.025596512440515147`,
0.03347236242221212`, 0.00814762226979778`, 0.`,
0.00795349920686863`};

graph1 = ListPlot[{Null},
ImageSize -> Medium,
PlotRange -> {{0, 200}, {0, 0.1}}, FrameLabel -> {"X", "Y"}];
graph2 = ListPlot[f, Filling -> Axis, Joined -> True]; Show[graph1, graph2]

Date Subject Author
9/12/13 David Park
9/12/13 Themis Matsoukas