Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Mathematica exports curves in pieces to Illustrator

286 views
Skip to first unread message

Ralph Reinbeck

unread,
Jan 2, 2004, 4:34:23 AM1/2/04
to
Hello. I use Mathematica to generate plots in EPS files, and then I
use Adobe Illustrator to edit the EPS files. Here's my problem: I
plot y = x^2 and open the EPS file in Illustrator, but when I click on
the curve, Illustrator only highlights (selects) a piece of the
parabola (and not the entire parabola). Sometimes it even selects a
piece of the curve and a piece of an axis, but I cannot select just
the curve, or just an axis. I've posted a similar question on the
Adobe Forums, but with little success.

Any suggestions? I appreciate any help that's out there.

Thanks a lot,
R

Bo Le

unread,
Jan 3, 2004, 1:37:11 AM1/3/04
to
Hi,

I come across the same thing, when I am importing *M*athematica's EPS into
CorelDRAW. Why this is so, can be easily understood, since the M's plot
constitutes from final line segments. To see this, pick out the Out Graphics
argument and look into it with FullForm command.

The bottom line is that you will never get some kind of an Illustrator
native smooth Bezier curve out of you EPS, but it's up to you to accomplish
this. For example, you wee about having your plot and axis joined together.
You should unjoin them somehow with some kind of a command like Ungroup All.

At least in CorelDRAW it's quite easy to collect the line segments into a
final smooth curve and I don't see why this couldn't be possible in Adobe
app.

Hope that helps a bit, bye!

Borut
Slovenia


"Ralph Reinbeck" <Matti...@hotmail.com> wrote in message
news:bt3duv$pku$1...@smc.vnet.net...

Selwyn Hollis

unread,
Jan 3, 2004, 1:40:14 AM1/3/04
to
I'm afraid that's something you'll just have to live with. However, by
clicking and dragging, you can usually select many segments at once.
Once you've got them all selected, you can them "group" them.

-----
Selwyn Hollis
http://www.math.armstrong.edu/faculty/hollis

AES/newspost

unread,
Jan 4, 2004, 5:00:10 AM1/4/04
to

> I'm afraid that's something you'll just have to live with. However, by
> clicking and dragging, you can usually select many segments at once.
> Once you've got them all selected, you can them "group" them.

> Why this is so, can be easily understood, since the M's plot


> constitutes from final line segments. To see this, pick out
> the Out Graphics argument and look into it with FullForm command.

First paragraph may be correct -- but (I suspect) only because, for
whatever reason, "that's the way Mathematica does it". I'm skeptical
that Mathematica *has* to do it that way -- that is, has to break a
single curve into some number of smaller sub-segments -- for any major
technical reason; and it would be nicer if it didn't do it that way.

Are there technical reasons (maximum number of points per Line[], or
something like that) why Mathematica has to do it this way?

Also, if you Select first segment A, then segment B, of a segmented
curve of this type after transferring it from Mathematica to Illustrator, the
curve appears continuous. Does this mean that the final point of
segment A and the initial point of segment B are the same? -- or just
very close to each other? Or does the EPS file somehow contain enough
data that Illustrastor knows how to fill in the gap between last A and
first B points?

Yasvir Tesiram

unread,
Jan 4, 2004, 5:02:13 AM1/4/04
to
Hi,
I usually Ungroup the entire graphic and you can use Shift+ObjectSelect
in Illustrator to select common graphics objects within the main graphic.
Alternately, you can use Prolog and Epilog to render graphics in order, in
Mathematica, which should convert to EPS accordinly. But I have only tried
this once or twice and I think I came to the conclusion that it was more a
hassle than anything.

Yas

Bo Le

unread,
Jan 5, 2004, 3:57:45 AM1/5/04
to
> First paragraph may be correct -- but (I suspect) only because, for
> whatever reason, "that's the way Mathematica does it". I'm skeptical
> that Mathematica *has* to do it that way -- that is, has to break a
> single curve into some number of smaller sub-segments -- for any major
> technical reason; and it would be nicer if it didn't do it that way.


I don't see any other, better way,
how Mathematica would handle this in EPS.


Borut

Thomas Manz

unread,
Jan 6, 2004, 4:19:01 AM1/6/04
to
Hi!

I had the same problem and found that Mathematica defines own functions in the eps-file. But the function "Mistroke" which "cuts" all the curves doesn´t seem to be necessary:

filename = "D:\\figure1.eps";
Export[filename, fig1]
epsfile = Import[filename, "Text"];
epsneu = StringReplace[epsfile, "Mistroke" -> ""];
Export[filename, epsneu, "Text"]

This small script just exports the graph fig1 to an eps-file, imports the file again, eliminates the "Mistroke" function and writes back the eps-file.

Till now I had no problems with this (not very clean) method!

Thomas


>>> Ralph Reinbeck<Matti...@hotmail.com> 02.01.2004 10:34:23 >>>

Yasvir Tesiram

unread,
Jan 6, 2004, 4:26:29 AM1/6/04
to
David,

As I understand it, when you save as EPS or other formats, some other
programs are called to save the file. As is the creation of postscript for
display in the frontend. The rendering in the FrontEnd
is done (I guess, someone correct me if I'm wrong), by using these
programs and the system "stdout". In the case of exported files,"EPS" just
happens to be a convenient format to work with when using Adobe
Illustrator. In a nutshell, a graphic is made from a Mathematica
defintion of points and lines which then gets converted to PS by some
translation program for display to the screen or other device like a
printer.
After having understood the difference between Graphics
primitives and directives, I can make basic 2D plots that are of
acceptable publication quality from Mathematica directly. Alternately you
can save the data and import it into graphing programs like SigmaPlot,
ProFit etc which have the convenience of "press-button" features. But, if
you have Mathematica and gain some proficiency in it, you don't need
these relatively expensive programs.
I also use your DrawGraphics package sometimes to save myself a headache.
I have used DrawGraphics to make 3D vector diagrams and have managed to do
most of the basic layout using Mathematica. Beyond this, I have always
used Illustrator to clean up the graphic. If you Ungroup the graphic in
Illustrator you will see many, many objects and you can zoom in, zoom out
and clean up the graphic as you please. Usually, items that need cleaning
up are lines which may have been rendered behind (before) a solid filled
object (e.g a Polygon). Some of my other 3D graphics are built up from
very large data sets and I have used Jens-Peers MathGL3D package to
visualise these data sets. They can also be imported into Illustrator, but
without sufficient memory and speed, they are cumbersome graphics to
work with.
Recently, I found my self working via the MathKernel directly (for
convenience mainly). On a Mac running MacOS 10.3, Wolfram does not provide
the programs athena or motif to render the graphics and have it displayed.
In this instance, I used "The GIMP" (http://gimp.org") to visualise the
graphic in preference to the program ghostscript by creating a temporary
"eps" file that could be read by the GIMP. But I am just learning
the basics of GIMP and so cannot give a full account of how it compares
with commercial programs. Certainly looks good for artistic work and may
not be all that science oriented.
I have found Illustrator to be extremely useful in cleaning up
Mathematica written "EPS" files. Another program is CorelDraw, but I
jumped off that "band wagon" a long time ago.
In so far as the Graphics Gallery on the WRI website is concerned, I don't
think there has been an auxilliary program that the graphics have been run
through apart from what they deliver already. It may be that there are
some differences between the binaries delivered for different platforms
and there could be any number of issues behind why Wolfram deliver what
they have delivered. For myself, at least, I have found a good degree of
consistency between graphics produced on Mac, Windows-PC, Linux-PC, using
graphics cards of various quality.

Cheers
Yas


> Yas,
>
> I have often wondered about programs that would take Mathematica plot output
> and allow improvements to be made on the plots. What programs are available,
> what will they do for you and roughly how much do they cost? How well do
> they work with 3D graphics? Are they worth it?
>
> One of the things I don't like about Mathematica 3D graphics is the poor
> rendering. There are often extra lines and spots that shouldn't appear in
> the graphics. Do programs like Illustrator solve these problems? When I look
> at some of the sample 3D plots on the WRI web site, they look as if they had
> been run through an auxiliary program.
>
> David Park
> dj...@earthlink.net
> http://home.earthlink.net/~djmp/


>
> From: Yasvir Tesiram [mailto:tesi...@omrf.ouhsc.edu]
>
> Hi,
> I usually Ungroup the entire graphic and you can use Shift+ObjectSelect
> in Illustrator to select common graphics objects within the main graphic.
> Alternately, you can use Prolog and Epilog to render graphics in order, in
> Mathematica, which should convert to EPS accordinly. But I have only tried
> this once or twice and I think I came to the conclusion that it was more a
> hassle than anything.
>
> Yas
>
> On Fri, 2 Jan 2004 Matti...@hotmail.com wrote:
>

Selwyn Hollis

unread,
Jan 6, 2004, 4:34:39 AM1/6/04
to
David,

I've used Macromedia Freehand for years, but I'm planning to switch to
Adobe Illustrator. (You can find full information and download a 30-day
trial version at www.adobe.com.) An application of that type is really
indispensable in a number of ways. You can easily touch up
Mathematica-generated graphics to get effects that would take a great
deal of effort to get in Mathematica, if possible at all.
(Anti-aliasing and color adjustments come to mind.) Moreover, technical
drawings are quite easy to produce once you get used to things.

(edit reply-to to reply)

AES/newspost

unread,
Jan 7, 2004, 1:31:55 AM1/7/04
to
In article <btb8u9$jq5$1...@smc.vnet.net>, "Bo Le" <bol...@email.si>
wrote:

Plot some simple curve, like e.g. a gaussian; export as EPS; open in
Illustrator; click on the curve with the "group select" tool (or
whatever it's called -- the arrow pointer with a "+" sign on it).

Typically you'll find you've selected a bunch of points, joined by
lines, that form only **part** of the curve. The remainder of the curve
is an additional set of points joined by lines. These two separate
segments are separate objects in the EPS and Illustrator file. You can
give 'em different colors, or line weights in Illustrator.

The question is: why can't, or don't, they come out of Mathematica as
**one** object? -- One set of points forming one Line[{}] in Mathematica
notation?

AES/newspost

unread,
Jan 7, 2004, 1:32:58 AM1/7/04
to
In article <btdvff$he$1...@smc.vnet.net>,
Selwyn Hollis <sh2....@misspelled.erthlink.net> wrote:

> I've used Macromedia Freehand for years, but I'm planning to switch to
> Adobe Illustrator. (You can find full information and download a 30-day
> trial version at www.adobe.com.) An application of that type is really
> indispensable in a number of ways. You can easily touch up
> Mathematica-generated graphics to get effects that would take a great
> deal of effort to get in Mathematica, if possible at all.
> (Anti-aliasing and color adjustments come to mind.) Moreover, technical
> drawings are quite easy to produce once you get used to things.


And at the elementary level just simple positioning of text labels in
graphics. If I have three curves that I want labelled "Low gain",
"Medium gain", "High gain" in a plot, I often use an
Epilog->{Text,Text,Text} sequence to stick the labels anywhere on the
plot, then drag 'em where they look best (and maybe modify the text) in
the Illustrator version of the graphic.

DIAMOND Mark R.

unread,
Jan 23, 2004, 3:26:16 AM1/23/04
to
Something I didn't see mentioned is the fact that Mathematica almost always uses
masks in the EPS of plots. I find that this complicates the editing process,
and the very first thing I do in Illustrator is go Edit -> Select -> Masks
and then delete them. I haven't yet encountered a plot where the Mask was
necessary. --
Mark R. Diamond

0 new messages