Display problems with "rectangle" function
Mostra commenti meno recenti
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
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Vector Volume Data in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!