How do I get single-stroke MarkerEdges?

4 次查看(过去 30 天)
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');

回答(1 个)

Alexandre Plourde
Alexandre Plourde 2021-10-15
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.

类别

Help CenterFile Exchange 中查找有关 2-D and 3-D Plots 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by