 |
|
List Archives > 
Maple User Group List Archive > 
Archive by date > 
This Month By Date > 
This Month By Topic
[MUG] plotsetup in maplets!
| [MUG] plotsetup in maplets! |
|
Author: Avelino Sousa
Posted: Thu, 31 Oct 2002 04:37:56 +0000
|
>> From: "Avelino Sousa" "linosousa"
Hi,
I'm creating a Maplet that shows the graphic of a function. I want to know
if it is possible to create a button that allows us to save the plot image
to a file (wmf type). How can we use the plotsetup instruction in a maplet?
_________________________________________________________________
MSN Hotmail, o maior webmail do Brasil. http://www.hotmail.com
|
| [MUG] Re: plotsetup in maplets! |
|
Author: Maple User Group
Posted: Mon, 4 Nov 2002 10:24:13 -0500 (
|
>> From: Maple User Group "maple_gr"
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
From: Douglas Wilhelm Harder "douglas"
Subject: plotsetup in maplets!
To: "maple-list"
Date: Fri, 1 Nov 2002 13:33:44 -0500 (EST)
Hello,
> I'm creating a Maplet that shows the graphic of a function. I want to know
> if it is possible to create a button that allows us to save the plot image
> to a file (wmf type). How can we use the plotsetup instruction in a maplet?
The following works, but it pops up a separate window (at least on Unix)
I guess on windows it would be plotsetup(window);
try
plotdev := subs( plotsetup(), 'plotdevice' );
plotsetup( 'window' );
use Maplets:-Elements in
Maplets:-Display( Maplet( [
TextBox[TB1]( 'visible' = 'false' ),
Button( "Hi", Evaluate( TB1 = 'f()' ) )
] ) );
end use;
catch:
plotsetup( plotdev );
end try;
For example, you could have them manipulate the plot, and then to save,
you would pop up an x11 or window plot which would then allow the user
to save it from the menus.
Cheers,
Douglas
--
Douglas Wilhelm Harder -: 3- -.- =.- -: -3 .* =. -:- :- . -: .= -:- * -:- -.
Department of Electrical and Computer Engineering http://ece.uwaterloo.ca/
University of Waterloo http://cheetah.vlsi.uwaterloo.ca/~dwharder/
.___ DC 2703 519-885-1211 x7023 http://links.uwaterloo.ca/
\ ."""". .-----._____.-----._______.-----._____.-----._____.--
\____/ --10-- http://www.scg.uwaterloo.ca/ http://mapleapps.com/
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Fri, 1 Nov 2002 11:03:02 -0800 (PST)
From: Robert Israel "israel"
To: "maple-list"
Subject: plotsetup in maplets!
It should work, but doesn't: this is a bug, and a very annoying one! For
example:
> with(Maplets[Elements]):
m:= Maplet([[Button("Plot", Evaluate(function="plotit")),
Button("Done", Shutdown())]]):
plotit:= proc()
plotsetup(gif, plotoutput="d:/tmp/foo.gif");
plot(x,x=0..1);
plotsetup(default);
end;
Maplets[Display](m);
The procedure plotit is executed, but no file "foo.gif"
is created. It seems that ordinary plotting to files is disabled
when a Maplet is active.
The only work-around I can suggest is to save the plot structure,
and produce the file when the Maplet exits.
Robert Israel "israel"
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia
Vancouver, BC, Canada V6T 1Z2
|
| [MUG] Re: plotsetup in maplets! |
|
Author: Bertfried Fauser
Posted: Mon, 4 Nov 2002 20:48:02 +0100 (
|
>> From: Bertfried Fauser "fauser"
Dear Prof. Israel,
I am not sure that this has to be considered a bug! If maplest are used
over the web, there is a security swiths -z which disables file actions of
maple. I would guess that this is done by default when a maplet starts.
Think about the case that a bad user types some
march('delete',libname[1]); etc coden into a maplet or spys out your
harddisk (Ia m not aware what kind of pocess management M$ 200 or XP has,
but under unix maple has teh same rights as the user who starts it, and
that may be to much)
Why to use mapltes at all if you do not make them over the
internet availabe via MapleNet? I see no advantage of such a thing over
the gui I have in any case.
best
BF.
> It should work, but doesn't: this is a bug, and a very annoying one! For
> example:
% Bertfried Fauser Fachbereich Physik Fach M 678
% Universit"at Konstanz 78457 Konstanz Germany
% Phone : +49 7531 883786 FAX : +49 7531 88-4864 or 4266
% E-mail: "Bertfried.Fauser"
% Web : http://clifford.physik.uni-konstanz.de/~fauser
|
| [MUG] Re: plotsetup in maplets! |
|
Author: Robert Israel
Posted: Fri, 8 Nov 2002 15:13:04 -0800 (
|
>> From: Robert Israel "israel"
Security is certainly a concern if you're putting anything on the web, but
it's a separate issue. This particular Maplet was not put on the web.
AFAIK the -z option is global: it is specified on the command line and
affects the whole Maple session. Maplets in general are able to do
file I/O, and even the "system" and "ssystem" commands. So whatever
causes the inability of Maplets to make plot files, it isn't a concern
for security.
Robert Israel "israel"
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia
Vancouver, BC, Canada V6T 1Z2
On Mon, 4 Nov 2002, Bertfried Fauser wrote:
> Dear Prof. Israel,
>
> I am not sure that this has to be considered a bug! If maplest are used
> over the web, there is a security swiths -z which disables file actions of
> maple. I would guess that this is done by default when a maplet starts.
> Think about the case that a bad user types some
> march('delete',libname[1]); etc coden into a maplet or spys out your
> harddisk (Ia m not aware what kind of pocess management M$ 200 or XP has,
> but under unix maple has teh same rights as the user who starts it, and
> that may be to much)
>
> Why to use mapltes at all if you do not make them over the
> internet availabe via MapleNet? I see no advantage of such a thing over
> the gui I have in any case.
>
> best
> BF.
>
> > It should work, but doesn't: this is a bug, and a very annoying one! For
> > example:
>
> % Bertfried Fauser Fachbereich Physik Fach M 678
> % Universit"at Konstanz 78457 Konstanz Germany
> % Phone : +49 7531 883786 FAX : +49 7531 88-4864 or 4266
> % E-mail: "Bertfried.Fauser"
> % Web : http://clifford.physik.uni-konstanz.de/~fauser
>
>
|
Previous by date: [MUG] Re:Maple 8 under Debian GNU/Linux, Stian Davidsen
Next by date: [MUG] Animation of drawing a function point-by-point, Sandy Yates
Previous thread: [MUG] solving inequality, M A Suzen
Next thread: [MUG] Animation of drawing a function point-by-point, Sandy Yates
|
|
|