Discussion:
draw3d image always displaced into the upper right corner of the output window
(too old to reply)
Roland Salz
2017-07-01 20:44:30 UTC
Permalink
Raw Message
Hi,



since I started to use Maxima several years ago I noticed that draw3d images are never placed in the center of the
output window. They are always significantly displaced into the upper right corner, independently of the size of the
window. This displacement is so strong that less than half of the output window is actually usable for the output. The
rest is wasted. If you have complicated 3d-functions, this is a pity. The 3d image can be turned and view from different
perspectives, but the pivot point remains dislocated to the upper right corner. I know of no way to set it into the
center of the window.



This displacement I consider a strong handicap of this function which is otherwise a great thing. Is this only a Windows
issue? And is there nothing Maxima can do about this? We should try to find a solution for that. If we can't, maybe we
should address the problem to gnuplot. But I cannot imagine that there should be no way to fix this.



Best regards,

Roland
Michel Talon
2017-07-01 22:24:56 UTC
Permalink
Raw Message
Post by Roland Salz
Hi,
since I started to use Maxima several years ago I noticed that draw3d
images are never placed in the center of the output window. They are
always significantly displaced into the upper right corner,
independently of the size of the window. This displacement is so strong
that less than half of the output window is actually usable for the
output. The rest is wasted. If you have complicated 3d-functions, this
is a pity. The 3d image can be turned and view from different
perspectives, but the pivot point remains dislocated to the upper right
corner. I know of no way to set it into the center of the window.
This displacement I consider a strong handicap of this function which is
otherwise a great thing. Is this only a Windows issue? And is there
nothing Maxima can do about this? We should try to find a solution for
that. If we can’t, maybe we should address the problem to gnuplot. But I
cannot imagine that there should be no way to fix this.
No, on Linux, draw3d seems to work OK, the images are centered.
--
Michel Talon
Robert Dodier
2017-07-02 02:52:23 UTC
Permalink
Raw Message
Post by Roland Salz
This displacement I consider a strong handicap of this function which
is otherwise a great thing. Is this only a Windows issue? And is there
nothing Maxima can do about this? We should try to find a solution for
that. If we can't, maybe we should address the problem to gnuplot.
But I cannot imagine that there should be no way to fix this.
Can you give an example of an plotting input which gives an incorrect
result? Also probably include a screenshot so that we can understand
better what you are seeing. By the way, what does build_info(); report?

best

Robert Dodier
Roland Salz
2017-07-02 19:48:51 UTC
Permalink
Raw Message
-----Original Message-----
Sent: Sunday, July 2, 2017 4:52 AM
Can you give an example of an plotting input which gives an incorrect result? Also probably include a screenshot
so that we can understand better what you are seeing. By the way, what does build_info(); report?
Now I found out that the problem is caused by the option "set size x, y" in the user_preamble. I always use this option
in order to enlarge the drawing. If I don't, the drawing is indeed centered. But it does not fill the screen, only about
half of it. From the perspective in the beginning it may look pretty big, but if you turn it around and around, you find
out that only a rather limited part of the window is actually filled with it and that you would want to see it larger.
From certain perspectives you see that much less than half the windows is used.
With the set size option I can enlarge it, but then it moves into the right upper corner. The more I enlarge it, the
further it moves. So I gain nothing. I think the centering mechanism does not respond to this enlargement option
properly. Is there any workaround?
To my knowledge there is no other way to enlarge the drawing, or is there?
Unfortunately the screenshots are too big for the maxima list. I'll send them privately to Robert, Michel and Mario and
to whoever wants them.
This is what I do:

draw3d( user_preamble=["set size 1.3, 1.3"],
nticks = 200, dimensions = [1000,800], grid=true,
surface_hide=true,
zrange=[-100,100],
explicit(realpart(exp(a+%i*b)),a,-1,5,b,-5,5),
color=red,
explicit(imagpart(exp(a+%i*b)),a,-1,5,b,-5,5));

build_info(version="5.40.0",timestamp="2017-06-01
18:54:43",host="x86_64-w64-mingw32",lisp_name="SBCL",lisp_version="1.3.15")

Best regards,
Roland
Gunter Königsmann
2017-07-02 21:44:09 UTC
Permalink
Raw Message
I can acknowledge that gnuplot leaves way to much space around the plot.

I had the impression that the following user_preamble helps:

user_preamble="set tmargin 0;set bmargin 0; set lmargin 0; set rmargin 0",

Unfortunately I seem to encounter a second problem when trying to plot,
currently, so I can not verify if this really works on my system:

(%i2) draw3d(explicit(sin(x*y),x,1,2,y,1,2));
Message from maxima's stderr stream:
*** - Program stack overflow. RESET
[/build/clisp-O4UKdM/clisp-2.49/src/eval.d:573] reset() found no driver
frame (sp=0x7ffdfef71e00-0x7ffdfef6a030)
Exiting on signal 6
SERVER: Lost socket connection ...
Trying to restart Maxima.

(%i1) wxbuild_info();
wxMaxima version: 17.04.0
Maxima version: branch_5_40_base_83_ged207299a
Maxima build date: 2017-06-25 14:42:44
Host type: x86_64-pc-linux-gnu
System type:
gcc -falign-functions=4 -W -Wswitch -Wcomment -Wpointer-arith -Wimplicit
-Wreturn-type -Wmissing-declarations -O -DENABLE_UNICODE -DDYNAMIC_FFI
-DDYNAMIC_MODULES -I. -lreadline -lncurses -ldl /usr/lib/libavcall.so
/usr/lib/libcallback.so -lsigsegv libgnu_cl.a
SAFETY=0 TYPECODES WIDE_HARD GENERATIONAL_GC SPVW_BLOCKS SPVW_MIXED
TRIVIALMAP_MEMORY
libsigsegv 2.10
libreadline 5.2
libffcall 1.11 GNU C 5.3.1 20160205 X86_64
Lisp implementation type: CLISP
Lisp implementation version: 2.49 (2010-07-07) (built 3663837293)
(memory 3707383366)
(%o1)

Kind regards,

Gunter.
Michel Talon
2017-07-02 22:21:46 UTC
Permalink
Raw Message
Post by Gunter Königsmann
user_preamble="set tmargin 0;set bmargin 0; set lmargin 0; set rmargin 0",
Unfortunately I seem to encounter a second problem when trying to plot,
On my machine both the following work:

(%i7) draw3d(explicit(sin(x*y),x,1,2,y,1,2));
(%o7) [gr3d(explicit)]
(%i8) draw3d(user_preamble="set tmargin 0;set bmargin 0; set lmargin 0;
set rmargin 0",explicit(sin(x*y),x,1,2,y,1,2));
(%o8) [gr3d(explicit)]

but i see very lttle difference between the two.

With
draw3d(user_preamble=["set size 1.3, 1.3"],explicit(sin(x*y),x,1,2,y,1,2));
(%o9) [gr3d(explicit)]

the graph is indeed too big for the window, but it seems to suffer an
homothety of factoe 1.3 from an origin in the left down corner. Hence
the left and down margins are slightly bigger, which gives an impression
thatthe graph is shifted up and right.
--
Michel Talon
Gunter Königsmann
2017-07-03 04:49:50 UTC
Permalink
Raw Message
Post by Gunter Königsmann
user_preamble="set tmargin 0;set bmargin 0; set lmargin 0; set rmargin 0",
Additional idea: Would it be possible to set these margins to negative
values?

Kind regards,

Gunter.
Roland Salz
2017-07-03 19:16:52 UTC
Permalink
Raw Message
-----Original Message-----
Sent: Monday, July 3, 2017 6:50 AM
Post by Gunter Königsmann
user_preamble="set tmargin 0;set bmargin 0; set lmargin 0; set rmargin 0",
Additional idea: Would it be possible to set these margins to negative values?
Neither with zero nor with negative values I get any change of the size.

Roland

Michel Talon
2017-07-02 21:54:00 UTC
Permalink
Raw Message
Post by Roland Salz
Now I found out that the problem is caused by the option "set size x, y" in the user_preamble.
The documentation for set size in gnuplot says

`set size <XX>, <YY>` scales the plot itself relative to the size of the
canvas. Scale values less than 1 will cause the plot to not fill the
entire
canvas. Scale values larger than 1 will cause only a portion of the
plot to
fit on the canvas. Please be aware that setting scale values larger
than 1
may cause problems on some terminal types.

Maybe this is what you are seeing.
--
Michel Talon
Roland Salz
2017-07-03 18:58:26 UTC
Permalink
Raw Message
-----Original Message-----
Sent: Sunday, July 2, 2017 11:54 PM
The documentation for set size in gnuplot says
`set size <XX>, <YY>` scales the plot itself relative to the size of the
canvas. Scale values less than 1 will cause the plot to not fill the entire
canvas. Scale values larger than 1 will cause only a portion of the plot to
fit on the canvas. Please be aware that setting scale values larger than 1
may cause problems on some terminal types.
Maybe this is what you are seeing.
Yes, this seems to be exactly it. Of course, factor 1.3 is exaggerated. What I usually did is "set size 1.1, 1.1". I had forgotten about it, it was set in my init file. This way the drawing is a little bit larger than normal and it still remains entirely on the canvas. But the displacement from the center does not look very nice. The symmetry of the canvas is lost.
With
draw3d(user_preamble=["set size 1.3, 1.3"],explicit(sin(x*y),x,1,2,y,1,2));
(%o9) [gr3d(explicit)]
the graph is indeed too big for the window, but it seems to suffer an homothety of factoe 1.3 from an origin in
the left down corner. Hence the left and down margins are slightly bigger, which gives an impression thatthe
graph is shifted up and right.
This is exactly what I think, too.

Roland
Loading...