From: Matthew on 1 Feb 2010 06:12 I have a data set {x,y}. I want to plot it on the same graph along with a function that I can change with the Dynamic tool. I can't seem to use the Show[] command as, Show[Dynamic[ Plot[vis1[x]/0.8, {x, 0, 120}, PlotRange -> {0, 1}, AxesLabel -> {power, Relative Visibility1}]], ListPlot[{{20.5, 0.8035}, {40, 0.7986}, {59.5, 0.7885}, {80.5, 0.7842}, {100, 0.7778}, {119, 0.7738}, {140, 0.7695}, {160, 0.7 | 605}}, PlotRange -> {0, 1}]] Any ideas? Thanks!
From: David Park on 2 Feb 2010 03:26 We would have to know what vis1[x] is. What do you mean by change with the Dynamic tool? Do you mean drag points around? Here is an example without Dynamic: Show[ Plot[1/2 Sin[x/20] + 1/2, {x, 0, 120}, PlotRange -> {0, 1}, AxesLabel -> {power, Relative Visibility1}], ListPlot[{{20.5, 0.8035}, {40, 0.7986}, {59.5, 0.7885}, {80.5, 0.7842}, {100, 0.7778}, {119, 0.7738}, {140, 0.7695}, {160, 0.7 | 605}}, PlotRange -> {0, 1}] ] Now just keep double clicking on the Sin curve (say) until the points show, and then drag them around. However, I think you have something more useful in mind. We would have to know more specifically what that is. David Park djmpark(a)comcast.net http://home.comcast.net/~djmpark/ From: Matthew [mailto:m.a.broome(a)googlemail.com] I have a data set {x,y}. I want to plot it on the same graph along with a function that I can change with the Dynamic tool. I can't seem to use the Show[] command as, Show[Dynamic[ Plot[vis1[x]/0.8, {x, 0, 120}, PlotRange -> {0, 1}, AxesLabel -> {power, Relative Visibility1}]], ListPlot[{{20.5, 0.8035}, {40, 0.7986}, {59.5, 0.7885}, {80.5, 0.7842}, {100, 0.7778}, {119, 0.7738}, {140, 0.7695}, {160, 0.7 | 605}}, PlotRange -> {0, 1}]] Any ideas? Thanks!
From: Patrick Scheibe on 2 Feb 2010 03:29 Hi, use the Show inside your Dynamic: data = RandomReal[{-1, 1}, {20, 2}]; Manipulate[ Show[{ Plot[Sin[a x], {x, -1, 1}], ListPlot[data] }], {a, 2, 8}] Cheers Patrick On Mon, 2010-02-01 at 06:12 -0500, Matthew wrote: > I have a data set {x,y}. I want to plot it on the same graph along > with a function that I can change with the Dynamic tool. > > I can't seem to use the Show[] command as, > > Show[Dynamic[ Plot[vis1[x]/0.8, {x, 0, 120}, PlotRange -> {0, 1}, > AxesLabel -> {power, Relative Visibility1}]], > ListPlot[{{20.5, 0.8035}, {40, 0.7986}, {59.5, 0.7885}, {80.5, > 0.7842}, {100, 0.7778}, {119, 0.7738}, {140, 0.7695}, {160, 0.7 | > 605}}, PlotRange -> {0, 1}]] > > Any ideas? > > Thanks! >
|
Pages: 1 Prev: A question about a sphere Next: Ramsey Number R(3,k)=1,3,4 mod 5 |