Skip to content

Commit

Permalink
fix: clim-dependent scaling of cloud radius
Browse files Browse the repository at this point in the history
  • Loading branch information
StolkArjen committed Nov 18, 2022
1 parent 93e6bf8 commit 5d753d1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plotting/ft_plot_cloud.m
Expand Up @@ -317,7 +317,10 @@ function ft_plot_cloud(pos, val, varargin)
cmid = size(cmapsc,1)/2; % colorbar middle
colscf = 2*( (val-clim(1)) / (clim(2)-clim(1)) )-1; % color between -1 and 1, bottom vs. top colorbar
colscf(colscf>1)=1; colscf(colscf<-1)=-1; % clip values outside the [-1 1] range
radscf = abs(colscf); % radius between 0 and 1, small vs. large pos/neg effect

radscf = (val-min(abs(val)) * sign(max(val))); % 'vdown' representation
radscf = radscf / abs(clim(2)-clim(1)); % radius between 0 and 1, small vs. large pos/neg effect
radscf(radscf>1)=1; radscf(radscf<0)=0; % clip values outside the [0 1] range

if strcmp(scalerad, 'yes')
rmax = rmin+(radius-rmin)*radscf; % maximum radius of the clouds
Expand Down

0 comments on commit 5d753d1

Please sign in to comment.