Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: listplot and plot of the same function display in different scale...

  • To: mathgroup at smc.vnet.net
  • Subject: [mg51709] Re: [mg51617] listplot and plot of the same function display in different scale...
  • From: "Maxim A. Dubinnyi" <maxim at nmr.ru>
  • Date: Sat, 30 Oct 2004 03:47:53 -0400 (EDT)
  • References: <200410270554.BAA24581@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

See changes in Table inside ListPlot

solution = NDSolve[{y'[t] == -y[t], y[0] == 1}, {y}, {t, 0, 7}];

g0 = Plot[Evaluate[y[t] /. solution], {t, 0, 7},
      DisplayFunction -> Identity];
g1 = ListPlot[
      Table[{t,
          Evaluate[
            y[t] /. solution\[LeftDoubleBracket]1,
                1\[RightDoubleBracket]]}, {t, 0, 7, 0.05}],
      PlotStyle -> PointSize[0.015], DisplayFunction -> Identity];

Show[g0, g1, DisplayFunction -> $DisplayFunction]


That's all.


sean kim wrote:

>Hello group, 
>
>let's say you want to take a few points from an
>interploating function and ListPlot it. and then show
>it together with the graph object from Plot. 
>
>so...
>
>solution = NDSolve[{y'[t] == -y[t], y[0] == 1}, {y},
>{t, 0, 7}];
>
>g0 = Plot[Evaluate[y[t] /. solution], {t, 0, 7},
>DisplayFunction -> Identity];
>g1 = ListPlot[Flatten[Table[Evaluate[y[t]/.solution],
>{t, 0, 7, 0.05}]],PlotStyle -> PointSize[0.015],
>DisplayFunction -> Identity];
>
>Show[g0, g1, DisplayFunction -> $DisplayFunction]
>
>will show two plots in one graph, but plots have their
>own axis scale. the Plot[] object seems to be shrunk
>in scales due to ListPlot[] object having more points.
>(due to being tabled)
>
>How do i fix this so that both Plot have same axis
>scales? ( I want to show dots from ListPlot to overlay
>on top of Plot graph. )
>
>Thanks in advance for any insights. 
>
>
>sean 
>
>
>		
>__________________________________
>Do you Yahoo!?
>Yahoo! Mail Address AutoComplete - You start. We finish.
>http://promotions.yahoo.com/new_mail 
>
>



  • Prev by Date: MPS format, Linear Programming, and Optimization'MPSData
  • Next by Date: Re: gridlines styles.
  • Previous by thread: Re: listplot and plot of the same function display in different scale...
  • Next by thread: Re: listplot and plot of the same function display in different scale...