|
From: Daniel J S. <dan...@ie...> - 2003-12-12 19:33:33
|
Hans-Bernhard Broeker wrote:
>On Fri, 12 Dec 2003, Petr Mikulik wrote:
>
>
>
>>Colorbox should stay at that position where it is for the default view.
>>
>>
>
>Then it mustn't be output in terms of data coordinates, but in "view
>coordinates" or even directly in screen coordinates. The difference
>between the two is the matrix multiplication carried out by functions
>map3d_xy() and map3d_xyz() in util3d.c.
>
>So you would have to avoid calling either of those (or referring to
>trans_mat, for that matter) in draw_color_smooth_box().
>
>A little background: 3D plots have four distinct coordinate systems, not
>just the three we expose to the user in the 2D case:
>
> first/second (i.e. data coordinates)
> graph
> screen
>
>In 3D, the processing goes like this:
>
>data points ---- (ranges, map_x3d() & friend) ----> normalized coordinates
>
>normalized coordinates (set view, map3d_xyz()) ---> view coordinates
>
>view coordinates ----> ([xy]scaler, [xy]middle) ---> terminal coordinates
>
>Of these, the "normalized" most closely match the 2D "graph" coordinates,
>and terminal coordinates are essentially the same as "screen". View
>coordinates fall somewhere between those.
>
>For reference, the results in default 'set view' for the corners of the
>colour box are:
>
>res = {0.70899346400575247, -0.14693375672974057, 2.1484375602010033,
> 6.1537877952320801e-313}
>res = {0.77827549630850756, 0.49701905283832915, 2.1484375602010033,
> 6.1537877952320801e-313}
>
>(It's the first two coordinates only, in each case, that count).
>Apply scaler and middle and use those as cb_{x|y}_{from|to}, and you
>should be in business.
>
That is all correct, but you're underestimating the
appropriate change that needs to be made. Do as
Petr said,
set pm3d
splot x*y
If you ask me, even without doing a rotation, the
graph just doesn't look right. If the colorbox is
removed, there is a nice even border around the
plot. But when the color box is present, the plot
image isn't altered; the color box is just stuffed
in one of the margins. I'm arguing that the colorbox
position code should open that margin a bit more
and place the colorbox as a separate entity.
Repositioning the plotting region shouldn't be that
difficult. It would be the same for both 2d and 3d.
Hey, I just looked at the "pslatex" mode because
I recalled a problem with 3d borders there. I see
that "pslatex"'s output is slightly different than it
used to be. No longer are there separate files for
the postscript and Tex. It seems to work in a fairly
similar fashion so I tried some 3d plots... Without
a 3d rotation, and with the borders set to zero, the
plot comes out nice. But, doing a rotation and then
plotting results in a figure that, after a few steps
with latex and dvips, has a portion of the plot chopped
off. Some work is needed there.
My feeling is that to do the colorbox and margins
in a nice way is a lot more work than expected.
Dan
--
Dan Sebald
email: daniel . sebald @ ie ee . o rg
URL: ht tp://acer-access.c om/~dsebald @ acer-access.c om/
--
Dan Sebald
email: daniel . sebald @ ie ee . o rg
URL: ht tp://acer-access.c om/~dsebald @ acer-access.c om/
|