Path: csiph.com!weretis.net!feeder4.news.weretis.net!feeder5.news.weretis.net!news.solani.org!.POSTED!not-for-mail From: Karl Ratzsch Newsgroups: comp.graphics.apps.gnuplot Subject: Re: set range for second independent variable in special file '++' Date: Fri, 24 Mar 2017 13:15:06 +0100 Organization: solani.org Lines: 56 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Trace: solani.org 1490357713 31643 eJwNycEBADEEBMCWTrAoB6H/EnLzHWUQ2gQK0dUd91v8NQbFBporcQ+lmE8MT0bankrj/mP1ASc4EaY= (24 Mar 2017 12:15:13 GMT) X-Complaints-To: abuse@news.solani.org NNTP-Posting-Date: Fri, 24 Mar 2017 12:15:13 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 X-User-ID: eJwFwQkBwEAIAzBLY4WCHV7/Ei4xUNiuNKqdnSMxe0hTL+UgJAn4zO95w5Loi28tHF1bDyFsEZY= Cancel-Lock: sha1:Ek87jbDUII7fTKdwwh18ITiJ3gc= X-Mozilla-News-Host: news://news.solani.org In-Reply-To: X-NNTP-Posting-Host: eJwFwYEBwCAIA7CXECi25zgH/59ggqhVd2ehEoNZwTrjBpKyrcwjg/q2RTv958rSzFF8HOgB+2MQOA== Xref: csiph.com comp.graphics.apps.gnuplot:3593 Am 20.03.2017 um 20:38 schrieb Ethan A Merritt: > Ethan A Merritt wrote: >> Karl Ratzsch wrote: >>> It seems I can only specify one independent variable with range for >>> '++'. Is that so? >> >> Yes, but... >> That's mostly because it's not clear how one could use it. >> If you have an example of a type of plot that this would allow, >> I'd be happy to look into adding it. Hm, there are many, i think. The special filename "++" at the moment always directly maps the second independent variable to the y axis, but it could easily be meant to be sth else. Of course one can scale the values to the wanted sampling range in the "using" specifier, but you need a number of additional variables and it makes the script hard to read. Any kind of circular object would be an example, or generally a 3D plot with a coordinate transformation. Parametric mode is an alternative, but I think I'm not the only one who tries to avoid it because of the ugly syntax. ;-) >>> I want to plot a ribbon wound on a cylindrical core (not actually such a >>> boring one, but nevermind). >> set parametric >> splot radius*sin(u), radius*cos(u), (rise*u-v) >> set isosample 100, 10 > set hidden3d > replot Here's the actual plot I wanted to make, now using parametric mode. It's a short electric coil with a large volume of constant magnetic flux density. a=-0.012 # zero for even coil width n=9. # windings l=20.;r=8. # lenght and radius d=0.5 # distance between windings #PRIVALOV, DVINSKIKH, VIETH, 1996, JMagRes A, 123, 157-160 k(n,a) = l/2 / (pi*n + a*pi**2*n**2) # normalise height to l s(th,a) = k(n,a) * (th + a*th*abs(th)) # conductor center h1(th,a) = (s(th+2*pi,a) + s(th,a))/2 - d/2 # edge 1 h2(th,a) = (s(th-2*pi,a) + s(th,a))/2 + d/2 # edge 2 set param set xr[-r:r]; set yr[-r:r] set urange [-n*pi:n*pi] set vrange [0:1] set isosample 1000,8 set hidden3d set view equal xyz set xyplane 0 splot r*cos(u),r*sin(u),h1(u,a)*v/2 + h2(u,a)*(1-v)/2