Exporting a figure with transparent markers

조회 수: 2 (최근 30일)
Samantha Cox
Samantha Cox 2016년 4월 1일
댓글: Samantha Cox 2016년 4월 5일
I need to export a figure with transparent markers. I can not currently find a solution for this. Usually I use export_fig, but this is not working. I have tried plot2svg (which just spits back errors), saveFigure does not work, save2pdf, print, or saving through the interface to any format. Normally I save to .png.
The figure was generated through:
hLine=plot(X,Y,'o','MarkerSize',5,'MarkerFaceColor','k','MarkerEdgeColor','none')
drawnow; hMarkers = hLine.MarkerHandle; hMarkers.get; hMarkers.FaceColorData = uint8(255*[0;0;0;0.5]);
Any help is appreciated
  댓글 수: 1
Jeevan Joishi
Jeevan Joishi 2016년 4월 5일
How is it different from having no markers at all or having set the 'MarkerEdgeColor' set to none?

댓글을 달려면 로그인하십시오.

답변 (1개)

Mike Garrity
Mike Garrity 2016년 4월 5일
Reaching inside the Line object and messing with its undocumented internals is not a supported operation for a variety of reasons. One of the reasons is that print won't be able to see what you've done.
There are supported ways to create objects with transparency. For example, in R2015b or R2016a, you could do this:
npts = 250;
X = 1:npts;
Y = randn(1,npts);
scatter(X,Y,'filled','o','MarkerFaceColor','black','MarkerFaceAlpha',.5)
print('-dpdf','foo.pdf')
  댓글 수: 1
Samantha Cox
Samantha Cox 2016년 4월 5일
My university only has matlab version 2015a. On the help files it says that FaceAlpha is possible for scatter objects after 2014b, but this does not seem to be true. I found a way to get around it using patches to make the markers...

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by