Inconsistent plotting behavior of polyshapes between R2017b and R2018a
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
MathWorks Support Team
il 25 Mag 2018
Modificato: MathWorks Support Team
il 5 Set 2018
I am running the code below to plot polyshapes using nsidedpoly in MATLAB R2018a, but I get different behavior when running the program as a whole and executing it section wise.
My reproduction code is as follows:
%%part 1:
figure
pgon = nsidedpoly(6,'radius',1/2);
plot(pgon)
hold on, grid on, axis equal
%%part 2:
ps = pgon.translate(0,1*sqrt(3)/2);
plot(ps)
My findings are:
- Selecting and executing all lines at one time by pressing F9 results in the correct coloring
- Selecting and evaluating the two parts one after another results in wrong coloring (the second polyshape is transparent, the second color is overlaying the first polyshape).
Risposta accettata
MathWorks Support Team
il 5 Set 2018
Modificato: MathWorks Support Team
il 5 Set 2018
This unexpected behavior occurs due to a bug within the triangulation method of polyshape in MATLAB R2018a. This problem has been fixed in MATLAB R2018b and is also not present in MATLAB R2017b or before.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Elementary Polygons in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!