Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accumulated and verified updates #36

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
198 changes: 0 additions & 198 deletions GraphicsPlotting/BreakPlot.asv

This file was deleted.

2 changes: 1 addition & 1 deletion GraphicsPlotting/BreakPlot.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function h=BreakPlot(y_break_start,y_break_end,break_type,axes_handle)
% BreakPlot(x,y,y_break_start,y_break_end,break_type)
% BreakPlot(y_break_start,y_break_end,break_type)
% Produces a plot who's y-axis skips to avoid unecessary blank space
%axis_handle is obtained by get(gca).
%
Expand Down
8 changes: 5 additions & 3 deletions GraphicsPlotting/DendrogramMatrix.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
%
% Recommended usage: [DC,order]=DendrogramMatrix(C);
% To show matrix use : imagesc(DC); or pcolor(DC); - to show grid
function [DC,order,clusters,h,Z]=DendrogramMatrix(C,varargin)
function [DC,order,clusters,h,Z,cophenetDist]=DendrogramMatrix(C,varargin)
%default options
toPlotBinaryTree=0;
figureHandle=[];
Expand Down Expand Up @@ -76,8 +76,10 @@
%calculate euclidean distance
Y=pdist(C,linkMetric);
Z=linkage(Y,linkMethod);
%C = cophenet(Z,Y);
%I=inconsistent(Z,4);
if nargout==6
[~,cophenetDist] = cophenet(Z,Y);
end
%I=inconsistent(Z);

if strcmp(Orientation,'right')
pO1=[1 3];
Expand Down
79 changes: 79 additions & 0 deletions GraphicsPlotting/colormap2D.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
function [CM,CMP,h]=colormap2D(varargin)
parseObj = inputParser;
addParameter(parseObj,'nIntensities',100,@isnumeric);
addParameter(parseObj,'nColors',256,@isnumeric);
addParameter(parseObj,'blackAddition',0,@isnumeric); %adds black to top color, 0 value gives only white
addParameter(parseObj,'multiplicationFactor',8,@isnumeric);%[0-Inf] - makes rate of change stronger
addParameter(parseObj,'additionFactor',1.8,@isnumeric);%[0 1]- the higher makes changes weaker in total
addParameter(parseObj,'plotCartColorBar',1,@isnumeric);%plot a colorbar in cartesian coordinates
addParameter(parseObj,'plotPolarColorBar',1,@isnumeric);%plot a colorbar in polar coordinates
addParameter(parseObj,'plotPolarExample',0,@isnumeric);%plot a possible implementation of the color map on a polar plot
addParameter(parseObj,'inputParams',0,@isnumeric); %if 1 plots the possible inputs to the function

parseObj.parse(varargin{:});
par=parseObj.Results;
if parseObj.Results.inputParams
disp(par);
return;
end

CMap=hsv(par.nColors);
cmapR_theta=repmat(CMap,[1 1 par.nIntensities]);
M=[];M(1,:,1:par.nIntensities)=(par.additionFactor+(0:(par.nIntensities-1))/par.nIntensities).^par.multiplicationFactor;

cmapR_theta=bsxfun(@times, cmapR_theta+par.blackAddition*ones(size(cmapR_theta)),M);
cmapR_theta=(cmapR_theta-min(cmapR_theta(:)));
cmapR_theta=cmapR_theta./max((cmapR_theta(:)));
cmapR_theta=1-cmapR_theta;

CM=permute(cmapR_theta,[1,3,2]);

if par.plotCartColorBar
h.f=figure('Position',[200 200 100 800]);
h.h=axes;
image(CM);axis tight;
ylabel('Color');
xlabel('Intensity')
end

if par.plotPolarColorBar
[X,Y]=meshgrid(0.01:0.01:1,0.01:0.01:1);
X=X-0.5;Y=Y-0.5;

[theta,rho]=cart2pol(X,Y);
normTheta=floor(1+((theta+pi)/2/pi)*(par.nColors-1));
normRho=floor(1+(rho/0.5)*(par.nIntensities-1));
normRho(normRho>par.nIntensities)=1;
CMP=zeros(100,100,3);
p{1}=sub2ind(size(CM),normTheta(:),normRho(:),ones(numel(normRho),1));
p{2}=sub2ind(size(CM),normTheta(:),normRho(:),2*ones(numel(normRho),1));
p{3}=sub2ind(size(CM),normTheta(:),normRho(:),3*ones(numel(normRho),1));

CMP(:)=cat(3,CM(p{1}),CM(p{2}),CM(p{3}));

h.fP=figure('Position',[200 200 130 120]);
h.hP=axes;
image(CMP);axis tight equal off;
end

%
if par.plotPolarExample
[nRC,~,nTC]=size(cmapR_theta);

fP=figure('Position',[200 200 130 115]);
hP=polaraxes;colormap(hP,'hsv');hold on;

nR=50;
nT=20;
R=1:nR;
Theta=1:nT;

for i=1:nR
for j=1:nT
%plot(R(i),Theta(j),'.','MarkerSize',20,'Color', cmapR_theta( ceil(R(i)/nR*nRC), : , ceil(Theta(j)/nT*nTC) ) )
polarplot(R(i)/nR*2*pi,Theta(j),'.','MarkerSize',5,'Color', cmapR_theta( ceil(R(i)/nR*nRC), : , ceil(Theta(j)/nT*nTC) ) )
end
end
title(['Mul=' num2str(par.multiplicationFactor) ', Add=' num2str(par.additionFactor)])
set(hP,'RTick',[]);
end
4 changes: 2 additions & 2 deletions GraphicsPlotting/myErrorBar.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function [h,hE,hB]=myErrorBar(x,y,dy,width,varargin);
function [h,hE,hB]=myErrorBar(x,y,dy,width,varargin)
%[hE,hB]=myErrorBar(x,y,dy,width,varargin)
%width [0-1] - the width in normalize units of the relative fraction of the bar (e.g. width=1 -> error bar in size of bar), leave empty [] if needed.
%[h,hE,hB]=myErrorBar(1:8,Int,Int+IntStd,0.4,'Bfacecolor',[0.3 0.3 0.3],'BLinewidth',5,'Ecolor','k');
Expand Down Expand Up @@ -76,7 +76,7 @@

%update axis arguments
set(h,'xtick',x);
set(h,axisVarArgIn{:});
axes(h,axisVarArgIn{:});



Expand Down
6 changes: 6 additions & 0 deletions GraphicsPlotting/tmp2.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
121.5 35 151.5 65
left 2 right

ballCoordinates

[0 0 143 100]
Binary file removed dataAnalysisObjects/@MEAAnalysis/._MEAAnalysis.m
Binary file not shown.
Loading