MathGroup Archive 2009

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

Search the Archive

Re: Overlaying List...Plots with other Plots?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg103465] Re: Overlaying List...Plots with other Plots?
  • From: Bill Rowe <readnews at sbcglobal.net>
  • Date: Wed, 23 Sep 2009 07:25:00 -0400 (EDT)

On 9/22/09 at 7:09 AM, max at alcyone.com (Erik Max Francis) wrote:

>Bill Rowe wrote:
>>I don't know that there is a standard way. And as for proper way, I
>>would say anything that yields the desired result can be considered
>>proper. In any case, here is one way

>>data = RandomReal[1, {10, 2}]; f = FindFit[data, m x + b , {m, b},
>>x];

>>Plot[m x + b /. f, {x, 0, 1}, Frame -> True, Axes -> None, Epilog
>>-> {Point[data]}, PlotRange -> {.95 Min@data[[All, 2]], 1.05
>>Max@data[[All, 2]]}]

>Thanks to everyone who responded with your suggestions.  A variant
>of this one looks like the best for my purposes, since I want to
>smoothly be able to support multiple plot types (Plot, LogPlot,
>etc.) without needing a carefully and completely constructed layout
>for each variant. Plotting the curve fit _first_ and then using
>the Epilog option
>seems like the easiest approach.

There is one potential gotcha with this approach when using
LogLogPlot or LogPlot.

Consider the graphic generated by

LogPlot[Exp[x], {x, 0, 2.5},
  Epilog -> {Green, Point@{2, 10}, Red, Point@{2, Log[10]}}]

Notice there is a visible red point but not a visible green
point. That is to get the data in the Epilog portion to plot
correctly, there has to be the correct Log transformation.



  • Prev by Date: Huge memory leaks when importing two-dimensional array in Mathematica
  • Next by Date: Algorithm for computation sequence
  • Previous by thread: Re: Overlaying List...Plots with other Plots?
  • Next by thread: deleting style sheets