Unfortunately, "plotmatrix" does not support this "scatter" like functionality as it uses "plot" and "histogram" internally to generate plots. I work with MathWorks Technical Support and I have forwarded an enhancement request for this functionality to the developers.
As a workaround, you can modify "plotmatrix" for your workflow. You can open "plotmatrix" using the following command.
Copy the contents of this file to a new M file in your working directory and let's call it "plotmatrix_custom". Line 153 of this function calls "plot" which generates off diagonal plots in the final figure. Modify this line to call "scatter" as follows.
hh(i,j,:) = scatter(reshape(x(:,j,:),[m k]), ...
reshape(y(:,i,:),[m k]),markersize*ones(m,1),1:m,'filled','parent',ax(i,j))';
This will generate plots with the desired functionality. Note that the fourth argument (1:m) provides individual colors to each datapoint. Also, comment out line 155 in order to avoid error as scatter plots do not have 'markersize' property. For more information on "scatter", refer to the following documentation.
Then use the custom function "plotmatrix_custom" instead of "plotmatrix" to generate the desired plots.
0 Comments
Sign in to comment.