Adept Scientific - English
The world's best software for research, science and engineering.
flag arrow
clearclear
 

 Adept Store | register Join My Adept | Flags  
Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055  
UKusdedksvnofi
Home
Products
Training
Consultancy
 Buy Online
Downloads
Education
Support
My Adept
International |  About Us |  Contact Us |  Press Room |  Jobs


The Next Steps

• Ask us a question
• Maple Product Tour
• Buy Maple Now
• View Maple Pricing
• Find out about Online Training
• Download a Brochure
• Request a Brochure
• Download a Demo
• Request a Demo
• Meet Our Team
• Read our RSS Feeds

Learn More

Maple Home
Maple 11 Professional
Maple 11 Academic
Maple 11 Student Use
Recorded Online Seminars
FREE Training Resources


MapleNet
Maple T.A.
MapleConnect
BlockImporter for Simulink
BlockBuilder for Simulink
Maple Toolboxes
Maple Rave Reviews
Maple Study Guides
Books about Maple
System Requirements

View Maple 10 in Action
Product Comparison Chart

Latest Information

New Features: Professional
New Features: Academic
The Maple Reporter
The Maple Reporter Online
Numerical Algorithms Group
(NAG)


Service & Support

Maple 10 Training Videos
MaplePrimes, blogs, forums
Elite Maintenance Program
Application Centre
Powertools
Maple User Group (MUG)
Join the Maple User Group
(MUG)

Search the Knowledge Base
Technical Support request

List Archives >  Maple User Group List Archive >  Archive by date >  This Month By Date >  This Month By Topic

[MUG] plots from Maple

Search email archive for  

[MUG] plots from Maple
Author: Malte HENKEL    Posted: Thu, 17 Oct 2002 12:45:45 WETDST

>> From: Malte HENKEL "henkel"

Consider the following problem. One has defined a function, say e.g.
f := x-> sin(x*Pi);

and then makes a plot command

plot( f(x), x=0..1);

Fine. Now, HOW do I get the data created by this plot into a text file
and in the form:

1st column with values of x 2nd column with values of f(x)

in order to feed them into a high-quality graphics program ?
(please don't tell me that Maple makes publication-quality plots ...)

I'd like to have something called maple_to_file with does the following:

p1 := plot( f(x), x=0..1):
maple_to_file(p1, `file_name`);

to see the data points generated by plot go in a two-column format into
a text file.

I work with Maple 4, so please avoid exotic things designed for these heavy
higher versions.

Thank you.

Malte Henkel
LPM, Universite Nancy I, France
"henkel"

[MUG] Re: plots from Maple
Author: Maple User Group    Posted: Tue, 22 Oct 2002 17:03:16 -0400

>> From: Maple User Group "maple_gr"

| >> From: Malte HENKEL "henkel"
| Now, HOW do I get the data created by this plot into a text file
| and in the form:
| 1st column with values of x 2nd column with values of f(x)

-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Fri, 18 Oct 2002 17:20:45 -0700 (PDT)
From: Robert Israel "israel"
To: "maple-list"
Subject: plots from Maple


Maple 4? I hope you mean Maple V Release 4.

If you examine the plot structure created by this command, you find
that the first operand is a CURVES object, whose first operand is the
list of points you want. You can print the points in the format
you want using fprintf. For Release 4, you need to use a name (delimited
by `...`) rather than a string ("...") which you would use in more modern
versions. For example:

> maple_to_file:= proc(P, fname)
local L, pt;
L:= op([1,1],P);
for pt in L do
fprintf(fname, `%f %f\n`, pt[1], pt[2])
od;
fclose(fname);
end;

Robert Israel "israel"
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia
Vancouver, BC, Canada V6T 1Z2


-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Sat, 19 Oct 2002 15:03:46 -0800
To: "maple-list"
From: "Mark Fitch" "afmaf"
Subject: plots from Maple

The output of any plot command is a PLOT structure which includes the list
of points. You only need to discard the extra parameters before writing
them to file.

Mark A. Fitch
"The heavens declare the glory of God" Psalm 19

"mfitch"
3321 E. 42nd Ave. Apt. C, Anchorage AK, 99508 USA
(907) 562-2528



-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

From: Stanley J Houghton "S.J.Houghton"
Date: Mon, 21 Oct 2002 13:23:01 +0100
To: "henkel" "maple-list"
Subject: plots from Maple


Try someting along the lines of

> f := x-> sin(x*Pi);
> a:=plot(f(x),x=0..1):
> b:=op([1,1],select(has,[op(a)],`CURVES`)):
> fd := open("c:/TestFile.txt",WRITE):
> for i to nops(b) do
> fprintf(fd,"%f,%f\n",b[i][1],b[i][2])
> od:
> close(fd);

I have long since disposed of my Maple 4 but if op([1,1],e) doesn't
work, try op(1,op(1,e)) instead.

For different formatting see the help pages for function fprintf.

Hope it helps
Stan



-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Mon, 21 Oct 2002 14:43:07 -0400 (EDT)
From: Carl Devore "devore"
To: "maple-list"
Subject: plots from Maple


maple_to_file:= (p,f)-> writedata(f,op([1,1],p));

Previous by date: [MUG] Bug VectorCalculus[Jacobian], Jarausch
Next by date: [MUG] Weird behavior of Maple 6 under XP and NT, Rafal Ablamowicz
Previous thread: [MUG] Plot Size, Joe Rody
Next thread: [MUG] Weird behavior of Maple 6 under XP and NT, Rafal Ablamowicz



Ready to buy?

Maple - single user licence
Add to shopping basket
$ 1,895.00
Upgrade to Maple 12 from v11
Add to shopping basket
$ 995.00
Upgrade to Maple 12 from v10 & below
Add to shopping basket
$ 1,395.00

Featured Downloads

What's New in Maple 11 for Professionals
Maple White Paper: Technical Knowledge - An Asset You Can Afford to Lose?
Maple in Electronics Application Pack
Maple in Robotics & Aerospace Application Pack
Maple in Finance Application Pack

Product Reviews

"Without the Maple software, we would have to spend weeks generating the equations of motion for every experiment. Then the chances that we did it right would basically be near zero. There would always be a mistake somewhere. It is very difficult to set up a dynamic motion model by hand."
- Jean-Claude PiedBeouf, Ph.D Manager of Robotics, Canadian Space Agency

"Its very good - highly accurate and easy to use. The speed of Maple allows me to change equations and quickly reintegrate them into the application, so more possibilities can be explored to achieve the precise effect desired."
Shawn Neely, Senior R & D Director for PDI/Dreamworks
adept

Top of the Page

Our Privacy and Terms and Conditions Statement
All Trademarks Recognised. Copyright © 2007, Adept Scientific plc.
Site designed and maintained by Adeptise

Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055