Thread Subject: EPS not formatted correctly when I open it in Illustrator

Subject: EPS not formatted correctly when I open it in Illustrator

From: giordano.sagredo@gmail.com

Date: 7 Apr, 2009 03:33:24

Message: 1 of 6

The code below reproduces the bug. I make a figure with different colored points in a plot (point color is given by a z-value). When I save it using -depsc2, it opens in Illustrator 9.0 with the following problems:

1-The graph is not visible until I ungroup a couple of opaque white rectangles, and then click 'undo clipping mask.'

2-Once I make it visible, it isn't vectorized. None of the lines, points, etc can be independently manipulated. It's as if Matlab saved it as a tiff or something.

I am using MATLAB Version 7 (R14) Service Pack 1, Illustrator 9.0.

You can recreate the error using the following code (and obviously, once these steps are done in Matlab, I then open foo.eps in Illustrator):

%Clear everything
close all;clear

%Create points to plot in v_all columns
core_vector=[-4:1:4];
num_elts=length(core_vector);
v_all=zeros(num_elts,2);
v_all(:,1)=core_vector';
v_all(:,2)=.5*core_vector';

%create a colormap that spans colorspace
minz = 1;
maxz = num_elts;
curcolmap = colormap;
curmapsize = size(curcolmap,1);
mapz = round(1 + ([1:num_elts]' - minz) ./ (maxz-minz) .* (curmapsize-1));

%Plot points
scatter3(v_all(:,1), v_all(:,2), [1:num_elts]', 40, curcolmap(mapz,:), 'filled')

%Save as eps for use in Illustrator 9
print -depsc2 -adobecset foo.eps

Subject: EPS not formatted correctly when I open it in Illustrator

From: Lawri

Date: 7 Apr, 2009 14:20:16

Message: 2 of 6

"giordano.sagredo@gmail.com" <giordano.sagredo@gmail.com> wrote in message <30699410.7972.1239075235337.JavaMail.jakarta@nitrogen.mathforum.org>...
> The code below reproduces the bug. I make a figure with different colored points in a plot (point color is given by a z-value). When I save it using -depsc2, it opens in Illustrator 9.0 with the following problems:
>
> 1-The graph is not visible until I ungroup a couple of opaque white rectangles, and then click 'undo clipping mask.'
>
> 2-Once I make it visible, it isn't vectorized. None of the lines, points, etc can be independently manipulated. It's as if Matlab saved it as a tiff or something.
>
> I am using MATLAB Version 7 (R14) Service Pack 1, Illustrator 9.0.
>
> You can recreate the error using the following code (and obviously, once these steps are done in Matlab, I then open foo.eps in Illustrator):
>
> %Clear everything
> close all;clear
>
> %Create points to plot in v_all columns
> core_vector=[-4:1:4];
> num_elts=length(core_vector);
> v_all=zeros(num_elts,2);
> v_all(:,1)=core_vector';
> v_all(:,2)=.5*core_vector';
>
> %create a colormap that spans colorspace
> minz = 1;
> maxz = num_elts;
> curcolmap = colormap;
> curmapsize = size(curcolmap,1);
> mapz = round(1 + ([1:num_elts]' - minz) ./ (maxz-minz) .* (curmapsize-1));
>
> %Plot points
> scatter3(v_all(:,1), v_all(:,2), [1:num_elts]', 40, curcolmap(mapz,:), 'filled')
>
> %Save as eps for use in Illustrator 9
> print -depsc2 -adobecset foo.eps
I do not know if this is a bug, becouse when I look at the source of the generated EPS file I see a Grid-image layout (like a bitmap) and not a plotted instruction set. it seems that this command lets matlab produce static images, that if they would be zoomed, would produce blocked edges.

as to why it does this, I have no Idea.

Subject: EPS not formatted correctly when I open it in Illustrator

From: giordano.sagredo@gmail.com

Date: 7 Apr, 2009 22:18:52

Message: 3 of 6

"giordano.sagredo@gmail.com" <giordano.sagredo@gmail.com> wrote in message <30699410.7972.1239075235337.JavaMail.jakarta@nitrogen.mathforum.org>...
> The code below reproduces the bug. I make a figure with different colored points in a plot (point color is given by a z-value). When I save it using -depsc2, it opens in Illustrator 9.0 with the following problems:
>
> 1-The graph is not visible until I ungroup a couple of opaque white rectangles, and then click 'undo clipping mask.'
>
> 2-Once I make it visible, it isn't vectorized. None of the lines, points, etc can be independently manipulated. It's as if Matlab saved it as a tiff or something.
>
> I am using MATLAB Version 7 (R14) Service Pack 1, Illustrator 9.0.
>
> You can recreate the error using the following code (and obviously, once these steps are done in Matlab, I then open foo.eps in Illustrator):
>
> %Clear everything
> close all;clear
>
> %Create points to plot in v_all columns
> core_vector=[-4:1:4];
> num_elts=length(core_vector);
> v_all=zeros(num_elts,2);
> v_all(:,1)=core_vector';
> v_all(:,2)=.5*core_vector';
>
> %create a colormap that spans colorspace
> minz = 1;
> maxz = num_elts;
> curcolmap = colormap;
> curmapsize = size(curcolmap,1);
> mapz = round(1 + ([1:num_elts]' - minz) ./ (maxz-minz) .* (curmapsize-1));
>
> %Plot points
> scatter3(v_all(:,1), v_all(:,2), [1:num_elts]', 40, curcolmap(mapz,:), 'filled')
>
> %Save as eps for use in Illustrator 9
> print -depsc2 -adobecset foo.eps

Lawri said:
"I do not know if this is a bug, becouse when I look at the source of the generated EPS file I see a Grid-image layout (like a bitmap) and not a plotted instruction set. it seems that this command lets matlab produce static images, that if they would be zoomed, would produce blocked edges.

as to why it does this, I have no Idea."

It never has done this before for me. Typically it generates a perfectly good eps file, with each object vectorized (or whatever the language is to describe it), so I can edit it in Illustrator.

Anyone seen this that can help?

Subject: EPS not formatted correctly when I open it in Illustrator

From: Andrew Stevens

Date: 7 Apr, 2009 23:43:01

Message: 4 of 6

"giordano.sagredo@gmail.com" <giordano.sagredo@gmail.com> wrote in message <2218378.11672.1239142762778.JavaMail.jakarta@nitrogen.mathforum.org>...
> "giordano.sagredo@gmail.com" <giordano.sagredo@gmail.com> wrote in message <30699410.7972.1239075235337.JavaMail.jakarta@nitrogen.mathforum.org>...
> > The code below reproduces the bug. I make a figure with different colored points in a plot (point color is given by a z-value). When I save it using -depsc2, it opens in Illustrator 9.0 with the following problems:
> >
> > 1-The graph is not visible until I ungroup a couple of opaque white rectangles, and then click 'undo clipping mask.'
> >
> > 2-Once I make it visible, it isn't vectorized. None of the lines, points, etc can be independently manipulated. It's as if Matlab saved it as a tiff or something.
> >
> > I am using MATLAB Version 7 (R14) Service Pack 1, Illustrator 9.0.
> >
> > You can recreate the error using the following code (and obviously, once these steps are done in Matlab, I then open foo.eps in Illustrator):
> >
> > %Clear everything
> > close all;clear
> >
> > %Create points to plot in v_all columns
> > core_vector=[-4:1:4];
> > num_elts=length(core_vector);
> > v_all=zeros(num_elts,2);
> > v_all(:,1)=core_vector';
> > v_all(:,2)=.5*core_vector';
> >
> > %create a colormap that spans colorspace
> > minz = 1;
> > maxz = num_elts;
> > curcolmap = colormap;
> > curmapsize = size(curcolmap,1);
> > mapz = round(1 + ([1:num_elts]' - minz) ./ (maxz-minz) .* (curmapsize-1));
> >
> > %Plot points
> > scatter3(v_all(:,1), v_all(:,2), [1:num_elts]', 40, curcolmap(mapz,:), 'filled')
> >
> > %Save as eps for use in Illustrator 9
> > print -depsc2 -adobecset foo.eps
>
> Lawri said:
> "I do not know if this is a bug, becouse when I look at the source of the generated EPS file I see a Grid-image layout (like a bitmap) and not a plotted instruction set. it seems that this command lets matlab produce static images, that if they would be zoomed, would produce blocked edges.
>
> as to why it does this, I have no Idea."
>
> It never has done this before for me. Typically it generates a perfectly good eps file, with each object vectorized (or whatever the language is to describe it), so I can edit it in Illustrator.
>
> Anyone seen this that can help?


Not sure if I fully follow your description of the problem, but I ran into a similar problem (I think) and solved it by specifying the renderer explicitly in my print command. As I recall, illustrator likes the painters renderer. So try modifying your code to:

print -depsc2 -painters -adobecset foo.eps

-Andrew

Subject: EPS not formatted correctly when I open it in Illustrator

From: giordano.sagredo@gmail.com

Date: 8 Apr, 2009 02:35:02

Message: 5 of 6

Andrew said:
"Not sure if I fully follow your description of the problem, but I ran into a similar problem (I think) and solved it by specifying the renderer explicitly in my print command. As I recall, illustrator likes the painters renderer. So try modifying your code to:

print -depsc2 -painters -adobecset foo.eps"

That is definite progress. Now the axes appear, but the data points are not there! (it should show a bunch of filled colored scatter points, but they aren't there at all).

Unfortunately, I think it is not solvable, as with each data point, the following friendly message appears:
'Warning: RGB color data not yet supported in Painter's mode.'

????

Anyone think of a workaround?

Thanks for the help so far.

Subject: EPS not formatted correctly when I open it in Illustrator

From: giordano.sagredo@gmail.com

Date: 8 Apr, 2009 03:42:04

Message: 6 of 6

http://www.mathworks.com/support/solutions/data/1-2IDNDP.html?solution=1-2IDNDP
Solution (note 'h3' is the handle for the scatter3 plot):

%
scatterGroupHandle = findall(h3, 'type', 'hggroup');
circleHandles = get(scatterGroupHandle, 'children');
colorCells=get(circleHandles,'CData');

for iCount = 1:length(circleHandles)
    myProps = get(circleHandles(iCount));
    set(circleHandles(iCount), 'markerEdgeColor', squeeze(myProps.CData),...
    'markerFaceColor',squeeze(myProps.CData),...
    'CData', [])
end

print -dill foo

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
renderer Andrew Stevens 7 Apr, 2009 19:45:05
illustrator Andrew Stevens 7 Apr, 2009 19:45:05
eps Andrew Stevens 7 Apr, 2009 19:45:05
rssFeed for this Thread

Contact us at files@mathworks.com