Message Boards Message Boards

0
|
2944 Views
|
1 Reply
|
1 Total Likes
View groups...
Share
Share this post:

Attempting to make an animated graph to export as a video

Posted 10 years ago
Hi,
I recently started using mathematica as the title says, I am trying to make an animated graph, of collected data, but I keep running into the same problem.
For some reason, when I got to export the graph, I keep getting the same video not matter if I change the range or not and I have no idea why.

If anyone could help me with this, that would be fantastic and much appreciated.

What I have interms of the code is pasted below. I have also attached the data file.
SetDirectory["..."]
data = Drop[Import["datafile.txt", "Table"], 8]

ListPlot[data[[All, {1, 3}]], AxesLabel -> {sec, \[Degree]C},
PlotRange -> {{240, 270}, {0, 2100}},
PlotLabel -> Style["Temperature (\[Degree]C)", FontSize -> 22, 
   RGBColor[.6, 0, 0]],
PlotStyle -> {RGBColor[.6, 0, 0], Thick},
AxesStyle -> Directive[RGBColor[0, 0, .6], Thick, 14],
Joined -> True]

<graph then displayed corrected>
Moviedata =
  Table[ListPlot[data[[1 ;; x, {1, 3}]],
    AxesLabel -> {sec, \[Degree]C},
    PlotRange -> {{240, 270}, {0, 2100}},
    PlotLabel ->
     Style["Temperature (\[Degree]C)", FontSize -> 22,
      RGBColor[.6, 0, 0]], PlotStyle -> {RGBColor[.6, 0, 0], Thick},
    AxesStyle -> Directive[RGBColor[0, 0, .6], Thick, 14],
    Joined -> True], {x, 2150, 2350}];
Export["...\\si1test.qt", moviedata,
"FrameRate" -> 10]
Attachments:
POSTED BY: Daniel Messina
Hi Daniel,
I think you have a typo.
When you generate the QT or MOV use Moviedata instead  of moviedata!
I also noticed that your plot range doesn't match your values. Plotrange should be PlotRange -> {{214, 235}, {0, 2100}}

Moviedata = Table[ListPlot[data[[1 ;; x, {1, 3}]],
AxesLabel -> {"sec", "\C"},
PlotRange -> {{214, 235}, {0, 2100}},
PlotLabel ->
Style["Temperature (\C)", FontSize -> 22,
RGBColor[.6, 0, 0]],
PlotStyle -> {RGBColor[.6, 0, 0], Thick},
AxesStyle -> Directive[RGBColor[0, 0, .6], Thick, 14],
Joined -> True], {x, 2150, 2350, 1}];

Export["si1test.mov", Moviedata, "FrameRate" -> 10]
Attachments:
POSTED BY: l van Veen
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract