Conflict between ezplot and linestyle
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Running my code I realized that linestyles is not recognized for graphs obtained exploiting ezplot. This issue does not happen for linewidth and for setting the color. Here you see part of the code fig3=ezplot(k-(((tax*a*(inf^esp1)*z)/(demfor))^esp2),[0 300], [0 1]) set(fig3,'color','black','LineStyle', '--','LineWidth',2) The commands color and linewidht are recognized. The curve is drawn but not dashed. Could someone suggest me a solution to the problem?
3 commentaires
Ghada Saleh
le 7 Août 2015
Hi Marco,
I tried reproducing this issue, but it is working normally for me. Please try the following code and see if the problem still persists.
fig = ezplot('x^2 - y^2',[0 300 0 100]);
set(fig,'color','black','LineStyle', '--','LineWidth',2);
If this is not working for you, it might be an issue related to the MATLAB version that you are using. If so, what is the MATLAB version you are using and on what platform (Windows, MAC, or Linux)?
Mike Garrity
le 7 Août 2015
The version of MATLAB matters too. A number of line style problems were fixed in R2014b. Marco may be seeing one of those.
If I run your simplified example in R2014a, I get this:
If I run it in R2015a, I get this:
The R2014a bug we're seeing here had to do with the length of the individual line segments that ezplot was creating. If you zoomed in, you would see that there actually was a line style, it was just getting smeared between adjacent segments. The graphics engine in R2015a does short line segments a bit differently to avoid this problem.
Réponses (0)
Voir également
Catégories
En savoir plus sur Graphics Object Identification dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!