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!