how to use gscatter plots
5 views (last 30 days)
Show older comments
I am wondering whether gscatter plots can be grouped with arrays containing two numbers:
I think I need to make structures from the data I am going to have in my datasets as datasets cant include arrays containing two og more numbers but structures can.
but my question is is this possible to write:
gscatter(temperature.zone_number, samlet_akt.zone_number, combination_salts_used, weight_percent_salts)
where the last two variables are my grouping variables and weightpercent is the grouping variable containing two numbers .
3 Comments
Walter Roberson
on 22 Dec 2021
The ways to call gscatter are
gscatter(x,y,g)
gscatter(x,y,g,clr,sym,siz)
gscatter(x,y,g,clr,sym,siz,doleg)
gscatter(x,y,g,clr,sym,siz,doleg,xnam,ynam)
You are passing in 4 parameters, so temperature.zone_number will be treated as x values, samlet_akt.zone_number will be treated as y values. Then the third parameter, combination_salts_used would be treated as a grouping number. The fourth parameter weightpercent would be treated as sym .
It sounds as if you want to pass in two different grouping parameters, as if there was a syntax like
gscatter(x, y, grouping1, grouping2)
but there is no syntax like that.
There is the syntax
gscatter(x, y, {grouping1, grouping2})
"in which case observations are in the same group if they have common values of all grouping variables"
Is that what you are looking for? If so
gscatter(temperature.zone_number, samlet_akt.zone_number, {combination_salts_used, weight_percent_salts})
Answers (0)
See Also
Categories
Find more on Line Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!