Hi Kalle-
Yes, animating a graph similar to the one you've described is entirely possible. It's also something that would require some scripting. Here is a link to our general page on animation http://www.originlab.com/doc/Origin-Help/Graph-Animation, and here is an example script for creating a sin wave animation that runs iteratively.
int codec = vw.FourCC(1, 0, 0, 0); // Microsoft Run Length Encoded
// Create video writer. (fileName, codec, framesPerSec, width, height)
// Triggers a dialog to set the name of your video. Best to save within User Files directory for permissions reasons dlgSave fname:=myfile ext:=*.avi title:="Save your video file"; int err = vw.Create(%(myfile$), codec, 30, 800, 600); if( 0 == err ) { range rZ = [Book1]Sheet1!col(J); //Active dataset var, a series of values the program runs through range ee = [Book1]Sheet1!col(L)[1]; //Modifier, each individual value in an iteration
range -wx rngXCol = %C; //Active x-range var loop(ii,0.02,rZ.GetSize()) //Loop var ii, from 1 to size of active dataset { //set display by angle ee = rZ[ii];
// Update the Angle display double dd = rZ[ii]; //integer cycles through x with loop var ii GObject goText = 1!updco; //defines object "gotext" in layer 1 as object xtext goText.text$ = %(rZ[L]$) = $(dd,.3*); //disp Lname equal to xval to 3 decimals if necessary
//set %C ee; // Wait for graph window to redraw. // This allows watching the animation while creating the video file. sec -p au; sec -pw %h; run.section(STANDARD,Refresh); // Write graph to video as a single frame. err = vw.WriteGraph(%H); if( err ) break; } // Release the video file from the writer so you can open it without closing Origin. vw.Release(); if( err ) type "WriteGraph error $(err)"; } else type "VideoWriter Create error $(err).";
I recently wrote this for the above radial graph of a sine wave being multiplied by a growing coefficient. The "updco" mentioned in the Angle display is an arbitrary name for the coefficient value textbox (given by right clicking on it and going to the "programming controls" dialog). As the value of the coefficient increases, the textbox displays the updated figure. I understand if this is somewhat difficult to follow, and unfortunately to run this kind of thing each script must be made specifically for each graph. This is just an example of the kind of script you'd need to make, if you wanted to display your graph being plotted from left to right, you would have to make "Range rZ" your set of values, and "Range ee" the value you want to display at a given time.
If you also wanted to make the bubbles on your plot gradual grow as they're plotted (like an "inflating" effect), you could also set up a range of growing values to do that as well. I apologize if I've left you with more questions than answers, the above script was made for a blog post that may be released in the future. If you would like to see the full OPJ and animation associated with it, just leave an email addressed to me at tech@originlab.com and I'd be glad to send this to anyone who wants to tinker with the concept.
Best regards, Ken Lefebvre Technical Services OriginLab Corp.
|