Exporting a plot where the line color is a gradient
1 次查看(过去 30 天)
显示 更早的评论
Hi,
I am having some trouble exporting my figures to a vectorised format to use in Adobe Illustrator. I am using plots where the color of the line is a gradient. These work well on the matlab figure, but don't look good in illustrator. Basically illustrator is splitting each segment of the line with a different colour into a separate layer. Does anybody have any suggestions what I can do?
Here is an example bit of code:
n = length(x);
p = plot(x,y,'r', 'LineWidth',5); hold on;
cd = [uint8(ColorFade)' uint8(255*linspace(0,1,n))'].'; %cd is a 4x100 uint8 matrix
drawnow
set(p.Edge, 'ColorBinding','interpolated', 'ColorData',cd)
Thanks
1 个评论
Pierre
2018-10-5
I hit that wall too. I finally had to resort to bitmap export of specific parts of the figure, as suggested below, although I hate it because it's non-editable. I recombine them with parts of an EPS/SVG export of the full figure to get a hybrid document with editable text.
Overall, graphical export is something Matlab does decently for simple graphics, but complex 3D graphics with gradients and transperencies are beyond their mastery.
回答(1 个)
Rajesh Balagam
2017-9-19
编辑:Rajesh Balagam
2017-9-19
It seems there is no direct way to export color gradients and transparency in vector format.
If you want to use the image as it is, you can try rasterizing the image in high resolution (600 dpi) as shown below:
print('-dpdf','test.pdf','-r600','-opengl')
However, you cannot edit the exported the image.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Printing and Saving 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!