|
From: Daniel J S. <dan...@ie...> - 2016-05-27 21:23:17
|
On 05/27/2016 03:38 PM, Ethan A Merritt wrote:
> On Wednesday, 25 May, 2016 13:58:32 Daniel J Sebald wrote:
>> On 05/24/2016 11:47 AM, Ethan A Merritt wrote:
>
>>> I still do not see the rationale for selecting "hidden3d" and then turning
>>> it off for a surface. (Yeah it's a bit confusing that "lines" really means
>>> "surface" in this context).
>>
>> Yes, and I think this is the source of the problem. Really, what I'm
>> interested in is not technically excluding a mesh "surface" from
>> hidden3d processing but more something that doesn't treat isoline
>> surfaces as being solid--yet those isolines can be hidden by other solid
>> surface elements. So, that's really what the issue is--i.e., gnuplot
>> automatically casts the wire mesh to solid surface in hidden3d mode.
>
>> That is, one can't have a wire mesh in hidden3d mode.
>
> It turns out that you can, so long as you input the lines in such a
> way that they are not automatically converted into a surface.
>
> For example:
>
> # This doesn't do what you want - both plot elements are treated as surfaces
> set hidden3d
> splot x*y, 3
>
>
> # But if we write out one plot and read it back in as separate lines,
> # the result is different because it is no longer treated as a surface.
>
> set hidden3d
> set table 'foo'
> splot 3
> unset table
> splot x*y, for [i=0:*] 'foo' every 1:1:0:i::i lt 3 lw 3 notitle
>
> Of course since it is not treated as a surface, no isosample lines
> running the other way are generated. If you want those you have
> to do something clever that transposes x and y at some stage.
> So here goes an example that does exactly what you want:
>
> %%%%%%%%% mesh.dem %%%%%%%%%%%%
>
> set hidden3d
> set xrange [-10:10]
> set yrange [-10:10]
>
> f(x,y) = x*y
> g(x,y) = 3
>
> set table 'foo'
> splot '++' using 1:2:(f($1,$2))
> set table 'baz'
> splot '++' using 2:1:(f($1,$2))
> unset table
> unset key
>
> splot for [i=0:*] 'foo' every 1:1:0:i::i with lines lt 1, \
> for [i=0:*] 'baz' every 1:1:0:i::i with lines lt 1, \
> g(x,y) lt 3 lw 3
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
> cheers,
>
> Ethan
>
I sort of went down this route implementing a "waterfall" plot (i.e.,
isolines in only one direction). That is, Octave's setting is
>> set(kids, 'meshstyle')
[ {both} | column | row ]
I used the existing code for the 'both' and then implemented either
column and row by repeating data in pairs (think of a surface having
zero width). I suppose I could just toss the 'both' case and implement
both column and row if 'both' is selected. That's effectively your example.
I'm working on something else at the moment, but I was going to send a
short example of waterfall meshes that could be added to the gnuplot
demos. Add a more interesting function to your example and 'foo' only
for one direction, 'baz' only for the other direction, and that's the
example.
Thanks,
Dan
|