How do I get single-stroke MarkerEdges?
Mostrar comentarios más antiguos
Since updating to 2020b, I have the following problem: when I export a plot to a graphics program, the marker edge is a 'compound path' (a filled area between two paths' instead of a single path/stroke.
This applies both to markers generated with scatter() and with plot(). I've tried different ways of exporting the plot, which had no effect, and now I'm wondering whether this is due to irrational behaviour by the graphics program, or might perhaps be caused by some of my own settings.
Is anyone familiar with this problem, and/or has any ideas on how to fix it?
%generate some data
data1=randn(12,1);
data2=randn(12,1);
figure;
s1=scatter(ones(size(data1,1),1),data1,45,[1 0 0]); %scatterplot data1 in red (at x=1.0)
hold on
p1=plot(1.1*ones(size(data2,1),1),data2,'og'); %plot marker data2 in green (at x=1.1)
ax1=gca;
ax1.XLim=[0.95 1.15]
%try different ways of exporting
copygraphics(ax1,'ContentType','vector');
print('-painters','-dpdf','Test_Print_painters');
exportgraphics(gca, 'Test_export.pdf');


Respuestas (1)
Alexandre Plourde
el 15 de Oct. de 2021
0 votos
This has annoyed me too. Here are two options I know of:
1) Use the Convert to Shape - Ellipse tool in illustrator. This will let you set the stroke weight and color as if it was a simple circle. However, illustrator will still track the 8 vertices per marker (instead of 4), which could be annoying if you have a lot of markers.
2) Export the markers as 'filled' circles from Matlab, then you can easily add a stroke in Illustrator. Note that this tended to cause issues in pre-2020 Matlab, but works well now.
Categorías
Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!