Exporting a plot where the line color is a gradient

1 回表示 (過去 30 日間)
SeanC
SeanC 2017 年 9 月 15 日
コメント済み: Pierre 2018 年 10 月 5 日
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
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
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.

カテゴリ

Help Center および File ExchangePrinting and Saving についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by