help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Outlines on filled symbols in a scatterplot


From: andrewcd
Subject: Outlines on filled symbols in a scatterplot
Date: Sat, 21 Jan 2012 10:09:17 -0800 (PST)

Hi All,

I'm trying to represent the fitted values of a bivariate regression with an
interaction term on a temperature plot overlain with a scatterplot.  In
order to convey how far the points are from the fitted values, I want to
make the points have colors.  The code below does this.  The problem is that
I walso want the points to have black outlines, so that those points close
to the fitted values can be seen -- right now, only the outliers are very
visible.  

I am also not figuring out how to make the scatter(whatever,...,"filled")
command to work.

One more thing:  I would also like to slice off the upper right hand corner
of the plot -- remove the color, because my fitted values have no support in
that region.  Is there a simple way of doing this that avoids the need for
GIMP/photoshop?  

Thanks in advance.  


clf
clear all

B_phi =   6.087086   
B_bcph =   3.986886  
B_int =  -.6931524  

ceci =   -.176444  
bc =  -.0271995   
bc2 =   .0002162    
trop1 =   3.344421   
subtrop =    3.91045   
f =  -.2066504  
manure =  -.1042446  
gh =   -2.37658  
cereal =   .7543417  
legume =   .8416939  
cons =  -32.02132   

B = [ceci bc bc2 trop1 subtrop f manure gh cereal legume cons]

ceci=    12.66929    
          bc=    24.74643    
         bc2=    1806.046   
       trop1=    .2678571   
     subtrop=    .6785714    
           f=    .5892857   
      manure=    .1964286   
          gh=    .8392857    
      cereal=    .3035714   
      legume=    .3035714   
      cons = 1
X =  [ceci bc bc2 trop1 subtrop f manure gh cereal legume cons]

Xb = X.*B
Xb = sum(X.*B)

phi = 3.5:.1:8;
bcph = 6.8:.1:13.2;

for i = 1:length(phi)
        for j = 1:length(bcph)
                mat(i,j) = phi(i)*B_phi+bcph(j)*B_bcph+phi(i)*bcph(j)*B_int+Xb;
                end end

ph_obs = [         4.5
      4.5
      4.5
      4.5
      4.5
      4.5
      4.5
      4.5
      4.5
      4.5
      4.5
      4.5
      4.6
      4.6
     3.75
     5.04
     5.04
     5.04
     5.13
     5.13
     5.13
      4.2
      4.2
      4.2
      4.2
      4.2
      4.2
     7.67
     7.67
     7.67
     7.77
     7.67
     7.67
     4.13
     4.13
     4.13
     4.13
     4.13
     4.13
      7.6
      7.6
      7.6
      7.6
      7.6
      7.6
      3.9
      3.9
      3.9
      4.7
      4.7
      4.7
      4.1
      4.1
     6.36
     6.36
     6.36];
     
bcph_obs = [          9.4
      9.4
      9.4
      9.4
      9.4
      9.4
      9.9
      9.9
      9.9
       13
       13
       13
      8.2
      8.2
      8.7
        7
        7
        7
        7
        7
        7
      9.4
      9.4
      9.4
      8.2
      8.2
      8.2
      9.4
      9.4
      9.4
      8.2
      8.2
      8.2
      9.4
      9.4
      9.4
      8.2
      8.2
      8.2
      9.4
      9.4
      9.4
      8.2
      8.2
      8.2
      7.4
      7.4
      7.4
      7.4
      7.4
      7.4
      7.4
      7.4
      9.2
      9.2
      9.2];
      
dcp = [       .4551265
 2.044285
 3.282942
 .5417769
 1.830936
 2.829592
 2.179922
 4.394422
  6.94908
 2.893987
 7.278488
 9.733147
 1.391149
   2.5978
-1.244858
 2.147537
 3.257637
 2.006539
 1.106964
 2.257064
 2.225966
 5.023451
 5.023451
 5.777792
 2.093451
 2.006099
 2.847793
 1.612145
 1.524792
 2.366486
 3.312145
 3.224792
 4.066486
 4.213608
 4.126256
 4.967949
 1.783608
 1.696255
 2.537949
 2.448172
  2.36082
 3.202514
 3.748172
  3.66082
 4.502514
 .8466198
 4.459268
 .6992677
 2.187752
   1.7904
   3.8604
 1.601188
 2.467839
 2.518787
 2.847762
 3.075929];

ph_obs = ph_obs+rand(length(ph_obs),1)*.1;
bcph_obs = bcph_obs+rand(length(bcph_obs),1)*.1;

pcolor(bcph,phi,mat); shading interp; colorbar; title("Fitted Value Plot");
hold on
scatter(bcph_obs,ph_obs,10,dcp)

xlabel("Biochar pH")
ylabel("Initial soil pH")

--
View this message in context: 
http://octave.1599824.n4.nabble.com/Outlines-on-filled-symbols-in-a-scatterplot-tp4316566p4316566.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]