How can I get correctly plotted lines when using Matlab in a Webbrowser?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Problem: When displaying a plot using the webbrowser, the result looks weird. Most points of the line are missing, only two straight parts are shown as in the appended image.
Tests until now: I tried to plot some random or fixed numbers (1d and 2d arrays) on different backend machines (
- Matlab R2021x with Matlab Proxy on Windows 10,
- Matlab R2022b within Docker container,
- https://matlab.mathworks.com/
) and web browsers browsers (
- Firefox and Chromium on Manjaro Linux for all cases;
- Firefox and Edge on Windows 10 for first case [Windows as backend])
Results: The simplified code used for the screenshot is
format compact
x = 1 : 10
y = randn( 1, 10 )
plot( x, y );
Some kinds of basic plots do not get displayed correctly, but this seems to be slightly inconsistent: plot(x) seems to work, but plot(x,y) with random y values seems to result in the wrong behaviour. plot3() and scatter() seem to work, but polar() does not.
In some cases, the plots do not get displayed at all.
Question: How do I fix this plotting error?
1 commentaire
Star Strider
le 30 Jan 2023
I cannot reproduce that problem. Your code works correctly for me in MATLAB Online (Firefox) and there is no problem with the figure.
Réponses (1)
Cris LaPierre
le 30 Jan 2023
I was not able to reproduce in MATLAB Online using Edge or Chrome.
2 commentaires
Voir également
Catégories
En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!