Loop into parametric plot or splot From: Brouard Nicolas - 2007-03-18 20:41 ```Hi, I have been subscribed to gnuplot-dev some years ago and you could find my name in old archives concerning a patch on logscale (if I remember well). I am back to your gnuplot-beta list, because I discovered your new gif animated function in 4.2 and 4.3 (I made a Mandriva rpm of your latest snapshot for my own use but I will submit it to Cooker soon if you don't see any objection). You can have a look at the animations that I did for Wikipedia at http://commons.wikimedia.org/wiki/Image:Foucault-anim.gif but also at http://commons.wikimedia.org/wiki/Image:Foucault-rotz.gif . You can get the gnuplot sources in the description of theses pages. Any hint to improve the drawings? Also the mathematics are in fr.wikipedia.org/wiki/Pendule_de_Foucault but the size of the second drawing is too big (for the memory of commons, see http://bugzilla.wikimedia.org/show_bug.cgi?id=2888) and can't be processed easily. Another Wikipedian used Gimp in order to decrease the size of it and got a thumb, but now I uploaded a newer version and the thumb can't get through. Any hint to play with lower number of colors and reduced indexed colors. Trying to still improve the drawings I tested your for loop, but in parametrics mode something like: plot [t=0:2.*pi] for[i=0:2] sin(t+i),t will give strange results (not stupid result) and something like plot [t=0:2.*pi] for[i=1:2] sin(t+i),t outputs a warning parametric function not fully specified Many thanks for any answer. Nicolas ```
 Re: Loop into parametric plot or splot From: Daniel J Sebald - 2007-03-19 08:40 ```Brouard Nicolas wrote: > Hi, > I have been subscribed to gnuplot-dev some years ago and you could find > my name in old archives concerning a patch on logscale (if I remember > well). > > I am back to your gnuplot-beta list, because I discovered your new gif > animated function in 4.2 and 4.3 (I made a Mandriva rpm of your latest > snapshot for my own use but I will submit it to Cooker soon if you don't > see any objection). > > You can have a look at the animations that I did for Wikipedia at > http://commons.wikimedia.org/wiki/Image:Foucault-anim.gif but also at > http://commons.wikimedia.org/wiki/Image:Foucault-rotz.gif . You can get > the gnuplot sources in the description of theses pages. Any hint to > improve the drawings? > > Also the mathematics are in fr.wikipedia.org/wiki/Pendule_de_Foucault > but the size of the second drawing is too big (for the memory of > commons, see http://bugzilla.wikimedia.org/show_bug.cgi?id=2888) and > can't be processed easily. Another Wikipedian used Gimp in order to > decrease the size of it and got a thumb, but now I uploaded a newer > version and the thumb can't get through. Any hint to play with lower > number of colors and reduced indexed colors. Try gifsicle -O Foucault-anim.gif > anim.gif which will reduce the color table from 256 to 16. (You may use gifsicle --info Foucault-anim.gif gifsicle --info anim.gif to verify this. It reduces the file by maybe 5 to 10%. What you will also see in the info is the size of successive images in the animation. Although not much changes from frame to frame in your demo, GIF works with subimages so has to include the whole subimage that includes all parts of the image that change. Nice demo though. Dan ```
 Re: Loop into parametric plot or splot From: Ethan Merritt - 2007-03-21 20:04 ```On Sunday 18 March 2007 13:41, Brouard Nicolas wrote: > Trying to still improve the drawings I tested your for loop, but in > parametrics mode something like: > plot [t=0:2.*pi] for[i=0:2] sin(t+i),t > will give strange results (not stupid result) and something like > plot [t=0:2.*pi] for[i=1:2] sin(t+i),t > outputs a warning > parametric function not fully specified Hmm. Yes, I can believe that. Both of my recent plot extensions (iteration and '+' as a pseudo-file) came with a caveat that I wasn't familiar enough with the parametric plot modes to test them thoroughly. The problem is poorly chosen syntax for parametric plots, syntax that we are now stuck with even though it is a pain to parse correctly. In "normal" plot commands a comma indicates the end of one plot and the beginning of another. In parametric plot commands the comma means something else entirely. The iteration code is not smart enough to distinguish the two cases. Fixing this will probably be a headache, but I'm sure it's possible. -- Ethan A Merritt ```
 Re: Loop into parametric plot or splot From: Daniel J Sebald - 2007-03-22 07:58 ```Ethan Merritt wrote: > On Sunday 18 March 2007 13:41, Brouard Nicolas wrote: > >>Trying to still improve the drawings I tested your for loop, but in >>parametrics mode something like: >> plot [t=0:2.*pi] for[i=0:2] sin(t+i),t >>will give strange results (not stupid result) and something like >> plot [t=0:2.*pi] for[i=1:2] sin(t+i),t >>outputs a warning >> parametric function not fully specified > > > Hmm. Yes, I can believe that. > Both of my recent plot extensions (iteration and '+' as a pseudo-file) > came with a caveat that I wasn't familiar enough with the parametric > plot modes to test them thoroughly. > > The problem is poorly chosen syntax for parametric plots, syntax > that we are now stuck with even though it is a pain to parse correctly. > In "normal" plot commands a comma indicates the end of one plot and > the beginning of another. In parametric plot commands the comma means > something else entirely. The iteration code is not smart enough to > distinguish the two cases. Fixing this will probably be a headache, > but I'm sure it's possible. That comma thing again? Yeah, that's a pain. Parsing is done in a linear fashion and sometimes one is stuck because full deciphering requires moving on before the desired information for a stage is complete. The last time that happened for me I think I just changed the syntax (still had that luxury) to avoid using a comma. plot [t=0:2.*pi] for[i=1:2] sin(t+i),t I assume is interpretted as plot [t=0:2.*pi] sin(t+1),sin(t+2), t because plot [t=0:2.*pi] for[i=1:2] sin(t+i),t,t plots as plot [t=0:2.*pi] sin(t+1),sin(t+2), t,t Dan ```
 Re: Loop into parametric plot or splot From: Brouard Nicolas - 2007-03-23 11:41 ```Le lundi 19 mars 2007 à 03:42 -0600, Daniel J Sebald a écrit : > Brouard Nicolas wrote: > > Hi, > > I have been subscribed to gnuplot-dev some years ago and you could find > > my name in old archives concerning a patch on logscale (if I remember > > well). > > > > I am back to your gnuplot-beta list, because I discovered your new gif > > animated function in 4.2 and 4.3 (I made a Mandriva rpm of your latest > > snapshot for my own use but I will submit it to Cooker soon if you don't > > see any objection). > > > > You can have a look at the animations that I did for Wikipedia at > > http://commons.wikimedia.org/wiki/Image:Foucault-anim.gif but also at > > http://commons.wikimedia.org/wiki/Image:Foucault-rotz.gif . You can get > > the gnuplot sources in the description of theses pages. Any hint to > > improve the drawings? > > > > Also the mathematics are in fr.wikipedia.org/wiki/Pendule_de_Foucault > > but the size of the second drawing is too big (for the memory of > > commons, see http://bugzilla.wikimedia.org/show_bug.cgi?id=2888) and > > can't be processed easily. Another Wikipedian used Gimp in order to > > decrease the size of it and got a thumb, but now I uploaded a newer > > version and the thumb can't get through. Any hint to play with lower > > number of colors and reduced indexed colors. > > Try > > gifsicle -O Foucault-anim.gif > anim.gif > > which will reduce the color table from 256 to 16. (You may use > > gifsicle --info Foucault-anim.gif > gifsicle --info anim.gif > > to verify this. It reduces the file by maybe 5 to 10%. > > What you will also see in the info is the size of successive images in the > animation. Although not much changes from frame to frame in your demo, GIF > works with subimages so has to include the whole subimage that includes all > parts of the image that change. Sorry for my late reply. The most memory consuming animated gif file is the second http://commons.wikimedia.org/wiki/Image:Foucault-rotz.gif where the view is from the oscillation plane (using a rotating set view). Thank you for the information on gifsicle. I don't know why ungifsicle is still distributed (by Mandriva for example) because the LZH patent is out now. Using gifsicle -O2 -k8 foucault-rotz.gif -o foucault-rotz-O2-k8.gif gives a 8.3% smaller output file from 426182 bytes to 390847 bytes. But for the static view (anim.gif) the reduction is 43% from 232333 to 133267. In both cases the terminal is open with: set ter gif animate optimize size 640,480 xffffff x000000 xa0a0a0 xff0000 x00c000 x0080ff xc000ff x00eeee; I don't know exactly what influences this reduction and its so varying factor (from 8.3% to 43%). Adding the crop terminal option for the '-anim.gif' gives a mostly left shifted image (cropped) which is only slightly smaller, from 232333 to 231954 bytes because the left part of the image is white. For the '-rotz' image, the crop option doesn't work as it should (I think): all frames ares left shifted (cropped) but their centers are not translated back correctly. I think that the crop option in an animated gif should crop the outmost largest image and centered them, for example like gifsicle does with its --crop 100,10+-Ox-0 option. Any hint on what gnuplot part of the sources I should look to fix this? For example, here are the first lines of the output of the command > gifsicle --info foucault-rotz.gif foucault-rotz.gif 72 images logical screen 640x480 global color table [256] background 0 loop forever + image #0 640x480 disposal asis delay 0.10s + image #1 472x456 at 127,6 disposal asis delay 0.10s + image #2 470x456 at 128,6 disposal asis delay 0.10s + image #3 468x455 at 129,6 disposal asis delay 0.10s + image #4 468x455 at 129,6 disposal asis delay 0.10s + image #5 466x454 at 130,6 in order to see how each frame is shifted from the biggest first #0 640x480 frame: frame #5 top left corner is 130 right and 6 pixels lower than top corner of frame #0, but frame #2 is only 127 right, in order to keep the same center (equilibrium of the pendulum and coordinates 0,0,0 of gnuplot) at the same position of the screen when the system is rotating and image growing or shrinking. >Nice demo though. You can access to the Gnuplot code of the drawing at http://commons.wikimedia.org/wiki/Image:Foucault-rotz.gif . It is licensed under GPL in order to be improved by anyone who wants to. The image itself is under FGDL and CC, but I would like that more and more scientific figures from Wikipedia are reproductible and thus move from 'Art' to 'Science'. I don't know which licence is the most appopriate for Gnuplot drawings but I suggested GPL. Any opinion? Regards, Nicolas > Nice demo though. > > Dan ```