Hi you all!
I would need to use pcshow in a GUI (app design). I tried something like this:
p=pcshow(app.UIAxes, [ptCloud.vertex.x ptCloud.vertex.y ptCloud.vertex.z], ptCloud.vertex.Scalar);
and this:
p=pcshow([ptCloud.vertex.x ptCloud.vertex.y ptCloud.vertex.z], ptCloud.vertex.GKI,'Parent',app.UIAxes);
but it doesn't work.
I also tried scatter3:
p=scatter3(app.UIAxes, ptCloud.vertex.x, ptCloud.vertex.y ,ptCloud.vertex.z, 36, ptCloud.vertex.Scalar);
but it does not work either (the app crashes without giving me any error with this last one).
How can I pass the ''app.UIAxes"? Is there a guide to learn by myself?
Thank you in advance

16 commentaires

Rik
Rik le 25 Fév 2021
I removed your question from the spam quarantine. It is ofte dificult to tell what might have set it off.
The app crashing is strange behavior. If the scatter3 function would not support uiaxes, only axes, I would have expected an error message, not a crash.
Veronica Taurino
Veronica Taurino le 25 Fév 2021
Modifié(e) : Veronica Taurino le 25 Fév 2021
Thank you for your reply.
I thought pcshow has a problem in GUI, therefore the word ''pcshow'' has been used for a spam filter.
Moreover even scatter3 has a known bug on GUI:
I am currently updating my version of Matlab to 2020b as suggested to make scatter3 works.
Rik
Rik le 25 Fév 2021
I had not searched for bugs relating to this, but that would explain why it crashes instead of triggering an error.
Veronica Taurino
Veronica Taurino le 25 Fév 2021
Modifié(e) : Veronica Taurino le 26 Fév 2021
Nothing. I can't make it work with 2020b either. I'm going to try plot3
Rik
Rik le 25 Fév 2021
If you attach your data (or code that will generate some random data), we might be able to help you.
Adam Danz
Adam Danz le 25 Fév 2021
It looks like you asked 3 similar questions within a short period of time which may have triggered the spam detector.
Veronica Taurino
Veronica Taurino le 25 Fév 2021
Hi Adam, I tried to post several times precisely because the first time I had the spam alert (I wrote the first post yesterday evening and it has been marked as potential spam, then this morning). Even a collegue of mine tried with his mathworks account and he had the same spam alert. I think the word ''pcshow'' may be marked to avoid similar question, currently without answer, but it is just my guess.
Rik
Rik le 25 Fév 2021
I don't think speculation will be very productive. Several people regularly check the spam filter. I hardly ever rescue a question that is older than a day. I think focussing on your actual question would be best. Should any reponse be caught by the spam filter, just flag it.
Do you still have a question?
Veronica Taurino
Veronica Taurino le 25 Fév 2021
Modifié(e) : Veronica Taurino le 25 Fév 2021
Hi Rik, thank you for the answer. However the link above explain the known issue with scatter3. And the following one explain the problem with pcshow:
I am trying with plot3, but I have some troubles defining my colormap. On appDesign I have something like this:
p=plot3(app.UIAxes_prova, ptCloud.vertex.x, ptCloud.vertex.y ,ptCloud.vertex.z,'.','MarkerSize',1);
but:
1) I can't use the colors previously defined.
I have an array of values (let's say random numbers from a MIN up to a MAX), let's call it ptCloud.vertex.Scalar. I am trying to transform it in RBG, using jet:
myColorMap = jet(round(max(ptCloud.vertex.Scalar)))
but then I don't how to assign this color map to the previous plot. I am afraid I can't...
2) I am afraid these plots are too slow to visualize in a GUI.
I'm going to think about it later.
Veronica Taurino
Veronica Taurino le 25 Fév 2021
Modifié(e) : Veronica Taurino le 25 Fév 2021
Any suggestion to plot points (3D space) in a GUI like mine in the fastest way? I finished to work on it except for the visualization.
EDIT: Hi Rik, I was answering to both of you (Adam and you) separately and you answered me while I was writing the message for you (I was trying to be polite but I didn't succeed by the tone of your answer. I am not a mother tongue, maybe we are "lost in translation"). I didn't want to speculate on anything, I was just answering to Adam to his hypothesis, explaining it couldn't be the short time among my questions the problem.
Rik
Rik le 25 Fév 2021
My replies were meant to be consise, I did not mean to impolite either.
As for your question: I tend to test these things as much as I can before spending hours on the visual design. That way you could have already discovered the performance issue in the inital stages of design. My only suggestion will take a lot of time: switch back to a normal figure instead of a uifigure. I would suggest a programmatic design; for general advice and examples for how to create a GUI (and avoid using GUIDE), have look at this thread.
Veronica Taurino
Veronica Taurino le 25 Fév 2021
Modifié(e) : Veronica Taurino le 25 Fév 2021
Hi Rik, thank you for your answer. I would feel real bad starting again in a programmatic way at this point, the GUI works just fine, I am adding the part on the visualization. My bad I didn't think about these kind of issues, I am not an expert and I will surely remember to change my workflow later on, thank you.
For now I have very nice "normal" figures in tabs (picture below - pcshow output). I going to try few more attempts before changing it all as you suggested.
Adam Danz
Adam Danz le 25 Fév 2021
Modifié(e) : Adam Danz le 25 Fév 2021
The first line of code in your question,
p=pcshow(app.UIAxes, [ptCloud.vertex.x . . .
is incorrect because pcshow does not accept an axis handles in input #1. That shouldn't crash the app but it should produce an error message (which you should share with us in the future).
The second line,
p=pcshow(. . .,'Parent',app.UIAxes_prova);
looks OK but is app.UIAxes_prova the axis handle? In the first line above, app.UIAxes looks like the axis handle. That should also produce an error message if app.UIAxes_prova is not an axis handle.
The third line also looks OK but may cause problems related to this post: App desiner GUI crashes when use scatter3
Veronica Taurino
Veronica Taurino le 25 Fév 2021
Modifié(e) : Veronica Taurino le 25 Fév 2021
Hi Adam, the first one was just a trial of mine, I tried to put the handle in the first position because it didn't work where I thought it should be (it is the scatter3 to crash, as I reported above):
Suggestion about this error?
My handle is called app.UIAxes_prova, I just forgot to delete the final part ('_prova') before posting here. I am going to edit the previous message.
Adam Danz
Adam Danz le 25 Fév 2021
Modifié(e) : Adam Danz le 26 Fév 2021
Ahhhh.... there we go. I'll reply in the answers section.
Veronica Taurino
Veronica Taurino le 2 Mar 2021
Modifié(e) : Veronica Taurino le 2 Mar 2021
Little update:
I can't make it work with plot3 either, it is too slow. I tried to improve the speed as suggested here:
and using the combination UIFUGURE/AXES instead of UIFIGURE/UIAXES, but it didn't improve my app.
So for now I'm going to use a visual artifact: creating a separate regular figure and aligned it to the command bar. After this delivery to my client, I'm going to use the programmatic way to do the job again, to include the plots tab within the GUI. Hoping in future update to improve the visual outcome of the App Design.
Thank you for your suggestions, greatly appreciated.
Best

Connectez-vous pour commenter.

Réponses (1)

Adam Danz
Adam Danz le 25 Fév 2021

0 votes

The error message indicates "Functionality not supported with UIAxes". Also, the documentation for the Parent property in pcshow, also states,
App designer uses UIAxes by default. You could try replacing the UIAxes with regular axes within the startup function of your app though I've never tried that so I'm not fully confident that it would work.
Alternatively you can generate the figure outside of the app in an independent figure using regular axes.
Lastly, perhaps you could substitute pcshow with a different plotting function that is supported by UIAxes. scatter3 or plot3 might work depending on what you're trying to plot, although that doesn't solve the crash problem scatter3 is producing under certain circumstances.

Catégories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by