Re: ListPlot Problem
- To: mathgroup at smc.vnet.net
- Subject: [mg92904] Re: ListPlot Problem
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Sat, 18 Oct 2008 06:23:46 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <ffd067b30810140918h3f819bbaq260e7edcbc2c8ad1@mail.gmail.com> <gd9llo$ekr$1@smc.vnet.net>
Youness Eaidgah wrote: > Dear Masters, > I wrote the following simple program to make a ListPlot, but it dose not > work: *snip* [... Input expressions are reproduced below ...] > and surprisingly i get no plot and also no error message, just a chart > without any point on it!! I have worked on it for a while, reading the list > plot options, but I am not able to get out of the mess. I would appreciate > if you could help me out. Using FullForm will reveal it all: what you pass to ListPlot is not a list of values but a list of dynamic expressions. ListPlot does not know what to do with this dynamic expression and it defaults to plotting a list of naughts. In[1]:= Clear[x, a, b, c, d] a = N[Dynamic[ Simplify[(8000*35 - 4000*(65 - x))*0.11 + (10000*35 - 2000*(65 - x))*0.11 + (12000*100 - 12000*65)*0.28 + (12000*100 - 12000*65)*0.22 + (12000*100 - 12000*65)*0.18 + (12000*100 - 12000*65)*0.1]], 10]; b = Dynamic[ Simplify[(8000*100 + 6000*x - 14000*65)*0.11 + (10000*100 + 4000*x - 14000*65)*0.11 + (12000*100 + 2000*x - 14000*65)*0.28 + (14000*100 - 14000*65)*0.22 + (14000*100 - 14000*65)*0.18 + (14000*100 - 14000*65)*0.1]]; c = Dynamic[ Simplify[(8000*100 + 8000*x - 16000*65)*0.11 + (10000*100 + 6000*x - 16000*65)*0.11 + (12000*100 + 4000*x - 16000*65)*0.28 + (14000*100 + 2000*x - 16000*65)*0.22 + (16000*100 - 16000*65)*0.18 + (16000*100 - 16000*65)*0.1]]; d = Dynamic[ Simplify[(8000*100 + 10000*x - 18000*65)*0.11 + (10000*100 + 8000*x - 18000*65)*0.11 + (12000*100 + 6000*x - 18000*65)*0.28 + (14000*100 + 4000*x - 18000*65)*0.22 + (16000*100 + 2000*x - 18000*65)*0.18 + (18000*100 - 18000*65)*0.1]]; f = {{12000, a}, {14000, b}, {16000, c}, {18000, d}} x = 10; Out[6]= {{12000, 360600.}, {14000, 340600.}, {16000, 281000.}, {18000, 189000.}} In[8]:= f//FullForm Out[8]//FullForm= List[List[12000,Dynamic[Simplify[Plus[Times[Plus[Times[8000. `10.000000000000004,35.`10.000000000000004], Times[-1.`10.000000000000004, (* Very long expressions deleted *) ... ]]]]]] In[9]:= ListPlot[f]//FullForm Out[9]//FullForm= Graphics[GraphicsComplex[List[],List[]], List[Rule[AspectRatio,Power[GoldenRatio,-1]], Rule[Axes,True], Rule[AxesOrigin, List[0,0]], Rule[PlotRange,List[List[0.`,0.`], List[0.`,0.`]]], Rule[PlotRangeClipping,True], Rule[PlotRangePadding, List[Scaled[0.02`],Scaled[0.02`]]]]] HTH, -- Jean-Marc