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.

 채택된 답변

Voss
Voss 2024년 1월 4일

0 개 추천

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

@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!
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!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Scatter Plots에 대해 자세히 알아보기

제품

릴리스

R2023b

질문:

2024년 1월 4일

댓글:

2024년 1월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by