split scatter into individual data
Afficher commentaires plus anciens
Hi,
I have a scatter/boxplot hybrid graph with one handle - I would like to be able apply groups to this data and show it as different colours or markers.
To clarify with an example - I have a graph of animal weights in a zoo by year. In my gui i would like to be able to highlight the weights that are african or European (indicated by a marker perhaps), or perhaps choose a differnt grouping and split by whether they are fish or birds (changing the colour of the markers perhaps).
I don't really want to replot as it's slow potentially - is there anyway of doing this via the handle and a logical index? Kind of like being able to change the size of the marker as you can in a normal scatter plot, but using catergorical data rather than numerical.
Currently I am at the stage where I have the grpahic handle and I have a variable of unique groups (that changes dependant on user selection). I feel like this could be easy but it's friday and I'm struggling!
thanks in advance.
2 commentaires
Adam
le 20 Sep 2019
The problem of trying to do it without replotting is that each marker type has to have its own scatter plot instruction. However you gather the data for this it has to be plotted separately, you can't divide up an existing scatter plot object into multiple parts.
It may be that if you know how many different groups you may have, that creating scatter plots with no data, but with each type of marker, might work and be faster, allowing you to then just change the XData and YData properties of these as you split your data.
The data splitting itself can presumably just be done on the raw data with indexing as you say. It's a while since I've worked with categorical data, but I think it still works simply for logical indexing.
corroMat
le 20 Sep 2019
Réponses (0)
Catégories
En savoir plus sur Discrete Data Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!