Borrar filtros
Borrar filtros

Exporting a plot where the line color is a gradient

3 visualizaciones (últimos 30 días)
SeanC
SeanC el 15 de Sept. de 2017
Comentada: Pierre el 5 de Oct. de 2018
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 comentario
Pierre
Pierre el 5 de Oct. de 2018
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.

Iniciar sesión para comentar.

Respuestas (1)

Rajesh Balagam
Rajesh Balagam el 19 de Sept. de 2017
Editada: Rajesh Balagam el 19 de Sept. de 2017
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.

Categorías

Más información sobre Graphics Performance en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by