Username Remember Me?
Password   forgot password?
   
   
sdscatter labels all the same
Posted: 18 August 2015 02:30 PM   [ Ignore ]  
Novice
Rank
Total Posts:  5
Joined  2010-06-25

When I plot my data using sdscatter all classes are plotted with the same (b+) marker.

Profile
 
 
Posted: 18 August 2015 02:43 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  365
Joined  2008-04-26

Hi Gerrit,

this may happen when a data set is constructed class-by-class, each time the first default marker in default_markers.m is used which is b+.

One thing to do is to call setmarkers on a data set, which will reset all markers based on defaults:

>> getmarkers(c)

ans 

    
'k*'    'k*'    'k*'

>> d=setmarkers(c)
'Fruit set' 260 by 2 sddata3 classes'apple'(100'banana'(100'stone'(60
>> 
getmarkers(d)

ans 

    
'b+'    'r*'    'go'

Does it work for you?

Kind Regards,

Pavel

Profile
 
 
Posted: 18 August 2015 02:49 PM   [ Ignore ]   [ # 2 ]  
Novice
Rank
Total Posts:  5
Joined  2010-06-25

indeed I was creating the dataset class by class.
Your solution fixed it, thanks for the fast reply.

Gerrit.

Profile
 
 
Posted: 09 October 2015 12:00 PM   [ Ignore ]   [ # 3 ]  
Novice
Rank
Total Posts:  5
Joined  2010-06-25

Hi Pavel,

my labels are also created image by image, resulting in something like:
>> getlab(a)
sdlab with 26000 entries, 26 groups
>> ans.list
sdlist (26 entries)
ind name
1 -
2 -
3 +++
4 +++
5 ++
6 ++
7 ++
8 ++
9 ++
10 ++
11 +++
etc.

Is there an easy way to relabel this, except using a regular expression, which is quite cumbersome, because I have many labels in different label sets.

thanks,
Gerrit.

Profile
 
 
Posted: 09 October 2015 01:56 PM   [ Ignore ]   [ # 4 ]  
Administrator
Avatar
RankRankRankRank
Total Posts:  365
Joined  2008-04-26

Hi Gerrit,

maybe you could directly rename a specific class using this approach:

>> load fruit
>> a
'Fruit set' 260 by 2 sddata3 classes'apple'(100'banana'(100'stone'(60

>> 
a.laba.lab=='banana' )='banana2'
'Fruit set' 
260 by 2 sddata3 classes'banana2'(100'stone'(60'apple'(100)

Multiple conditions can be combined in a Matlab way:

>> a.laba.lab=='apple' a.lab=='banana' )='fruit'
'Fruit set' 
260 by 2 sddata2 classes'fruit'(200'stone'(60)

As a side note, I don’t think that the regular expressions are too bad here. What about:

>> a
'Fruit set' 260 by 2 sddata3 classes'+'(100'++'(100'+++'(60

>> 
b=sdrelab(a,{'/^[+]{1}$','one plus'})
  
1: +      -> one pluss
  2
: ++     -> ++
  
3: +++    -> +++
'Fruit set' 260 by 2 sddata3 classes'++'(100'+++'(60'one plus'(100

>> 
b=sdrelab(a,{'/^[+]{2}$','two plusses'})
  
1: +      -> +
  
2: ++     -> two plusses
  3
: +++    -> +++
'Fruit set' 260 by 2 sddata3 classes'+'(100'+++'(60'two plusses'(100

>> 
b=sdrelab(a,{'/^[+]{3}$','three plusses'})
  
1: +      -> +
  
2: ++     -> ++
  
3: +++    -> three plusses
'Fruit set' 260 by 2 sddata3 classes'+'(100'++'(100'three plusses'(60)

here we anchor the pattern from both sides with ^ and $ and specify the number of repetitions.

Hope it helps,

Pavel

Profile
 
 
Posted: 09 October 2015 02:18 PM   [ Ignore ]   [ # 5 ]  
Novice
Rank
Total Posts:  5
Joined  2010-06-25

Hi Pavel,

in the end it appeared to be not too cumbersome at all, indeed I used a regular expression.
Here is what I did:

for labelset {'class''plant''score''serie''inoculum''symptoms''height'}
                labelset 
char(labelset);                            
                
aa=setlab(aa,labelset);
                
aa=setmarkers(aa);
                
l=getlab(aa);
                for 
labelindex=1:length(l.list)
                    
aa=sdrelab(aa,{ ['/' l.list(labelindex)]l.list(labelindex)});
                
end
end

Profile