Markers intersect with axis in MATLAB plot

조회 수: 22 (최근 30일)
Ben
Ben 2013년 7월 22일
답변: Alexander Weitzel 2022년 11월 7일
Hello
I am plotting some data with markers, e.g.:
loglog(t55,r55,'ko','markerfacecolor','w','markersize',12);
However this marker intersects with my axis and i can see the border outside the actual plotting area defined by xlim and ylim. Altering markersize and boundaries is no option!
How can I adapt my plot that only the part of the marker in plotting are is seen?
Thanks
  댓글 수: 1
Daniel Shub
Daniel Shub 2013년 7월 23일
I don't think it can be easily done. See a previous unanswered question of mine where I was trying to figure out the extents of the markers.

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

답변 (4개)

Ben
Ben 2013년 7월 23일
nobody?
  댓글 수: 1
Jan
Jan 2013년 7월 23일
Please do not bump your question by posting a pseudo-answer. When the readers did not find a solution before, bumping without adding new information, is a waste of time.

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


David Sanchez
David Sanchez 2013년 7월 23일
Set the axis according to your data, extending the limits to your need:
x= rand(10,1);
y = rand(10,1);
loglog(x,y,'ko','markerfacecolor','w','markersize',12);
ext=1; % adapt this value to your needs
axis([min(x)-ext max(x)+ext min(y)-ext max(y)+ext])
  댓글 수: 1
Jan
Jan 2013년 7월 23일
The OP wrote:
Altering markersize and boundaries is no option!

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


Jan
Jan 2013년 7월 23일
Try to clip the axes' children:
AxesH = loglog(t55,r55,'ko','markerfacecolor','w','markersize',12);
Child = get(AxesH, 'Children');
set(Child, 'Clipping', 'on');
But perhaps this matters the center of the markers only, but not if only parts of the circles are outside the axes' limits.
  댓글 수: 3
Jan
Jan 2013년 7월 23일
This means, that there is no trivial solution. Then explain, why you need this and in which format you ant to export the diagrams.
Ben
Ben 2013년 7월 23일
It's about plotting test results in a clean and nice way for a paper. Plots are exported as .eps files. I can edit them with CorelDRAW. That's not the way I intended to to it, but I guess its less work than fiddeling around with MATLAB.

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


Alexander Weitzel
Alexander Weitzel 2022년 11월 7일
Even though this question is already quite old, I can present a simple and viable solution for the problem of overflowing markers.
Assuming you are interested in a clean picture for an article or a dissertation, simply set 'ClippingStyle' to 'rectangle' and print the figure to pdf, parts of markers lying outside of axes are now clipped.
set(gca,'ClippingStyle','rectangle');
print(gcf,'foo.pdf','-dpdf','-r300','-bestfit');

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by