Need help with changing UIaxis scatter plot colors

Hello - I apologize if this is simple. I've been working for a day on this, and can't get it to work.
I have a UI that calls an XML file, allows filtering of the nodes, then you select an experiment from the filtered list in the bottom left, and plot will pull data from specified text nodes within the xml file. I've gotten the dropdown menus, etc done. Even the plotting I've gotten, I had a nice programmed lasso tool to change the color of points. However, about midway through suddenly the color change stopped working, and I'm totally lost as to why. I've stepped through dozens of times, I've even tried changing other properties of the plots, which do work (e.g. SizeData and Marker), but the point by point color changes just refuse to do anything. A lot of this I was helped with by GPT-4 (because this was my first UI ever and the turn around time precluded me from figuring it out myself), but like I've said, I've personally done the bug checking, and can't find anything wrong. Would anyone be willing to help?
If so, I took out the lasso feature and tried to start over, mirroring a previous version of the code that did work. So this version is much scaled down. But the point and click should work. The list box has a value changed callback that goes through various functions. The bottom five functions in the private editable methods section should be the only ones that are used at all.
Also, the first function "loadAndParseXML" pulls the xml file so just change the filepath.
Finally, the RPAModelcopy.mlapp is the pertinent app, while the txt file is the xml file, but MATLAB didn't allow xml to be uploaded, so I just changed the file extention to .txt. Just change it back. And finally, in case it helps, I also added one of the previous codes that is simpler in an app way in that it doesn't have two plots, but the code (including the lasso) is there, and it should work, along with shift+click, shift+lasso, multiple experiments selected, etc. In case it helps, its the second app, the RPA_ModelMostlyWorks.mlapp. Again, change the file extension at the first function to the xml.
If anyone is willing to look at this, thank you, and I'll be happy to clarify anything.

 Respuesta aceptada

Voss
Voss el 4 de En. de 2024
You need to set the scatter plot 'MarkerFaceColor' to 'flat' at some point, for the custom CData to take effect. For example, you can do it when the scatter plots are created or when you set the CData in updateScatterPlotAppearance, depending on what behavior you want.

3 comentarios

Voss
Voss el 10 de En. de 2024
@Edward Chandler: Did you get this to work?
@Voss Yes! So sorry. Writing my dissertation, and I completely forgot to respond or accept your answer. This was perfect, and I had no more issues with the color updating as far as getting a color to stick after I added that property. Thanks so much for your help!
Voss
Voss el 10 de En. de 2024
No worries, I just wanted to make sure you weren't still struggling with this. Glad it's working, and good luck on your dissertation!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Productos

Versión

R2023b

Preguntada:

el 4 de En. de 2024

Comentada:

el 10 de En. de 2024

Community Treasure Hunt

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

Start Hunting!

Translated by