Display problems with "rectangle" function
이전 댓글 표시
I'm using the rectangle function to display an obstacle in the mesh of my CFD code.
The problem is that if my mesh is too coarse (I mean something like 0.025x0.025 as the size of the cells) i get some display issues, like this:

As you can see the borders of the rectangle are not straight lines. Here's a zoom-in:

The preoblem disappears as soon as I refine the grid.
Here's the code for the plot in the figure above
position = [c1,c2,c3,c4]; % No problem with this two lines, I checked
color = [0.85 0.85 0.85];
figure
subplot(211);
surface(X,Y,kappa_1.*ca'.*cb'); % This is the surface plot of the reaction rate in the back. This should also be correct
axis([0 Lx 0 Ly]); title('reaction rate [mol/m3/s]'); xlabel('x'); ylabel('y');
colorbar; shading interp;
rectangle( 'Position', position, 'FaceColor', color); % This part of the code is responsible for the rectangle
I cannot figure out the cause of this issue. If someone could help me I would be very grateful.
Thanks
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Vector Volume Data에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!