johnyf / fig2u3d

Export MATLAB figure as U3D file or directly to 3D interactive PDF
http://www.mathworks.com/matlabcentral/fileexchange/37640-export-figure-to-3d-interactive-pdf
BSD 2-Clause "Simplified" License
62 stars 24 forks source link

color is not render as per original figure for Surf Plot #3

Open konarkk opened 8 years ago

konarkk commented 8 years ago

I have used Surf plot with single FaceColor, however while when exported to PDF, it retains default color of axis with 64 colors

I have created small example

 x = 0.1:0.1:1;
 y = sort(rand(1,10));

 % Number of radial spokes
 n = 21;

 % Transform data for cylindrical presentation
 theta = linspace(0,2*pi,n);

 xr = x.'*cos(theta);
 zr = x.'*sin(theta);
 yr = repmat(y.',1,n);

 surf(xr,zr,yr,'FaceColor',[1 0.2 0.1],'FaceAlpha',0.8,'EdgeColor','none')

One More Example

 [x,y] = meshgrid(-2:.2:2);
z = x.*exp(-x.^2-y.^2);
a = gradient(z);
surf(x,y,z,'AlphaData',a,...
'FaceAlpha','flat',...
'FaceColor','blue')

Now when this plot exported to PDF, it renders with Default Jet color

adhusch commented 7 years ago

This should be fixed by https://github.com/johnyf/fig2u3d/pull/13