tag:blogger.com,1999:blog-4020452510052679998.post301381109705845082..comments2024-03-25T22:54:48.195-07:00Comments on Gnuplot tricks: Plotting in 6 dimensions - parametric plot from a fileGnuplotterhttp://www.blogger.com/profile/10560778800525149384noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-4020452510052679998.post-61706636716075871292012-05-11T15:37:42.431-07:002012-05-11T15:37:42.431-07:00Gnuplotter I'm your fan!
Recently use your ex...Gnuplotter I'm your fan!<br /><br />Recently use your exotic fashion loop to plot a line progersively in separeted files. <br />These allow to animate the plot and syncronize with a movie. That's the code:<br /><br />a(x) = sprintf("\<br /> set output name.'%d.png';\<br /> plot '< head -%d NebF.NEB2.dat' u 1:4 with line;\<br /> unset out ; \<br /> ",x,x)<br /><br />LOOP = ""<br />f(x) = (LOOP = LOOP.a(x), x)<br />plot '< seq 1 100' u 1:(f($1))<br /><br />eval LOOPAlexishttps://www.blogger.com/profile/01862232188787274622noreply@blogger.comtag:blogger.com,1999:blog-4020452510052679998.post-78830094010051488122010-04-07T09:11:48.637-07:002010-04-07T09:11:48.637-07:00Thanks so much for your kind reply, and thanks for...Thanks so much for your kind reply, and thanks for putting together this wonderful blog.<br /><br />With your help, I was able to find the "+", etc. stuff in the documentation. This is in section "65.2.7 Special-filenames" of gnuplot-4.4.0.pdf, for others who may need the info.<br /><br />Your other answers were also all very helpful; I think I now have enough information to try some things. It may be a while before I get to since some other things currently have higher priority.<br /><br />Thanks again.<br />Mark.Unknownhttps://www.blogger.com/profile/00741078469685424543noreply@blogger.comtag:blogger.com,1999:blog-4020452510052679998.post-16425029681930837672010-04-06T08:38:59.756-07:002010-04-06T08:38:59.756-07:00Greetings Mark,
Thanks for visiting! You had quit...Greetings Mark,<br /><br />Thanks for visiting! You had quite a few questions, I will try to answer them.<br /><br />> 1) The part of the script that creates the ellipse.dat file has a ‘+’ as the file name. What is the ‘+’ (in single quotes) doing? I cannot find anything like this in the documentation.<br /><br />The '+' is a pseudo-file, and the purpose of that is that by using this, one can use plot modifiers for functions. E.g., if your colouring of a surface depends on the difference of the first and second column, you could not do this with a function, because a function plot looks like<br /><br />splot f(x,y) with pm3d<br /><br />or something similar. If you had a file containing three columns, then you could plot as <br /><br />splot 'foo' u 1:2:3 with pm3d<br /><br />Now, if you want to colour your surface as a function of $1-$2, you can do this<br /><br />splot 'foo' u 1:2:3:($1-$2) with palette.<br /><br />Since the introduction of the '+' pseudo-file, you can do the same thing with functions, as <br /><br />splot '+' u 1:2:(f($1,$2)):($1-$2) with palette<br /><br />You can find the documentation of this in gnuplot-4.4.rc1.pdf<br /><br />> 2) The “using (20*f($1)):(20*f($1)): etc.” stuff is a mystery to me also. I’ve looked at the ellipse.dat file, but I cannot figure out the relationships between the functions and their corresponding columns, except that there are 6 columns of numbers.<br /><br />I think, my comment above answers this question.<br /><br />> 3) It would be most convenient for me if the plot data and the plot commands were all in the same file. I will be generating the file using other software; conceptually, the result will be the chart, not the intermediate file(s). Is there a way to combine the data and plot commands into one file? I’ve seen some hints that this may be possible, but nothing that actually shows how to do it.<br /><br />This I wouldn't do. You can generate your data, foo.dat, and have a script file, foo.gnu, foo.gp, foo.plot, whatever, that plots your data file. However, if you insist, you can do what you want. All you have to do is to use the '-' pseudo-file. This does nothing but reads the command line. So, your file could be something like this<br /><br />plot '-' using 1:2 with lines<br />1 10<br />2 5<br />3 12<br />4 7<br />5 3<br />e<br /><br />This plots the data as usual. Just don't forget to close your data set with a trailing 'e' at the end, otherwise your gnuplot session will keep waiting for input. <br /><br />> 4) Is it possible to produce a chart that has scroll bars? I’d like to produce a very tall graph that can be scrolled, without having to replot.<br /><br />You can try to play with the canvas terminal, which was introduced in gnuplot 4.4. <br />Cheers,<br />ZoltánGnuplotterhttps://www.blogger.com/profile/10560778800525149384noreply@blogger.comtag:blogger.com,1999:blog-4020452510052679998.post-72495162583721963722010-04-05T14:48:14.070-07:002010-04-05T14:48:14.070-07:00Gnuplotter,
Thanks for your wonderful gnuplot exa...Gnuplotter,<br /><br />Thanks for your wonderful gnuplot examples. Your "Plotting in 6 dimensions - parametric plot from a file" is of particular interest to me, as I want to do something very similar.<br /><br />Instead of ellipses, I want simple rectangles that I can control the color of. I also want to specify the rectangle top, bottom, left, right (or similar). All the rectangles will be parallel to the plot axes. So the ellipse example is a great starting point for me. <br /><br />Unfortunately for me, I'm new to gnuplot. I've been studying the documentation, but I cannot find various features which seem to be crucial to your example.<br /><br />Here are some newbie questions for you –<br /><br />1) The part of the script that creates the ellipse.dat file has a ‘+’ as the file name. What is the ‘+’ (in single quotes) doing? I cannot find anything like this in the documentation.<br /><br />2) The “using (20*f($1)):(20*f($1)): etc.” stuff is a mystery to me also. I’ve looked at the ellipse.dat file, but I cannot figure out the relationships between the functions and their corresponding columns, except that there are 6 columns of numbers.<br /><br />3) It would be most convenient for me if the plot data and the plot commands were all in the same file. I will be generating the file using other software; conceptually, the result will be the chart, not the intermediate file(s). Is there a way to combine the data and plot commands into one file? I’ve seen some hints that this may be possible, but nothing that actually shows how to do it.<br /><br />4) Is it possible to produce a chart that has scroll bars? I’d like to produce a very tall graph that can be scrolled, without having to replot.<br /><br />Thanks so much for providing these detailed examples.<br /><br />Regards,<br />Mark.Unknownhttps://www.blogger.com/profile/00741078469685424543noreply@blogger.comtag:blogger.com,1999:blog-4020452510052679998.post-18241272656930575672010-02-25T13:33:02.189-08:002010-02-25T13:33:02.189-08:00I agree that this method is much more general and ...I agree that this method is much more general and customizable than the one made available by my patch. However, it is also fairly complicated - this is not something you'd want to show a beginner.<br /><br />And the very point of my patch was that the functionality (ellipse drawing) was already present, so by creating a new interface to it a relatively useful capability could be added to the program with relatively little effort.<br /><br />I also agree that the development cycle may be too long. But this is open source after all: you are free to get the development version and modify it for your personal use as you need. Sending a patch in and thus enabling others to profit from your work is optional.<br /><br />By the way, why are we writing in English? :)<br /><br />Péter JuhászUnknownhttps://www.blogger.com/profile/11172776607684714645noreply@blogger.comtag:blogger.com,1999:blog-4020452510052679998.post-34459947087710871632010-02-25T11:46:37.099-08:002010-02-25T11:46:37.099-08:00First, thanks for the kind words! Second, I have j...First, thanks for the kind words! Second, I have just written a reply to your post on the discussion group, without reading this, so that is sort of obsolete now. (This whole idea occurred to me when I saw your first comment a couple of weeks ago, and then someone mentioned that they wanted to plot galaxies, or what not.) <br />But I would still maintain that while the 'with ellipse' flag is certainly useful, it is limited to ellipses only. Also, it cannot be expanded, while this method can. (I can easily add two more dimensions, although I don't see the pressing need for it.) <br />My problem with patches is that the development cycle appears to be a bit long (I am not blaming anyone here, mind you!), so whatever you implement now will make it to the main branch in 3 years' time. That is a bit too long. However, I would love to see an implementation of parametric plot from a file, in a sense as I outlined in this post, so if you feel like collaborating on that, I would be interested.<br />Cheers,<br />ZoltánGnuplotterhttps://www.blogger.com/profile/10560778800525149384noreply@blogger.comtag:blogger.com,1999:blog-4020452510052679998.post-40542941648256150762010-02-25T11:23:31.157-08:002010-02-25T11:23:31.157-08:00Nice.
However, it is not entirely true that there...Nice.<br /><br />However, it is not entirely true that there is no other way to produce a plot like this.<br /><br />Please take a look at my patch at Sourceforge:<br /><br />http://sourceforge.net/tracker/?func=detail&aid=2953926&group_id=2055&atid=302055<br /><br />The patch adds a new 2D plot style "with ellipses" that makes such plots much easier to produce.<br /><br />In fact, a simple <br />plot 'ellipse.dat' u 1:2:3:4:(180/pi*$5):6 with ellipses lc pal<br />would do it.<br /><br />It's not yet in the CVS, but you can help persuade the developers to commit it :)<br /><br />(In the patch you will find a demo that implements a fully rotatable 3D Solar System orbit viewer, given a file of orbital elements. It uses a similar trick of building the plot command from a data file then executing it, but I used perl to build the command.)<br /><br />I also supplied an other patch earlier that extends the existing 'circles' style: you can now draw arcs with explicitly specified start and end angles, not only full circles. This feature is already committed to the CVS tree.<br /><br />By the way, your posts on this blog are very useful, I've learned a lot from them. Keep up the good work! <br /><br />Péter JuhászUnknownhttps://www.blogger.com/profile/11172776607684714645noreply@blogger.com