function reeplot(ree, linecolor) % Normalized rare earth element plotting function that plots trends without % gaps for missing elements % % syntax: reeplot(ree, linecolor) % ree: a n x 15 matrix that includes all UNNORMALIZED REE values for each sample in ppm. % Omitted values should be included as 'NaN'. Pm MUST be included as % 'NaN' Use the order: La, Ce, Pr, Nd, Pm, Sm, Eu, Gd, Tb, Dy, Ho, Er, Tm, Yb, Lu % linecolor: a n x 3 string matrix of color values. Colors to choose from % are as in the plot function. Color indicators mustbe input between % apostrophes; ex- 'r'. If you are pasting values from EXCEL, use two % leading apostrophes as EXCEL truncates the first assuming you are % indicating the cell is a string value, the pasted value in MATLAB will % only have one leading apostrophe. % % Color options: % b blue % g green % r red % c cyan % m magenta % y yellow % k black % % Note: within the code, several options for normaliztion values are % included. To switch values, enter the code (type- open reeplot) and uncomment the desired % values, making sure to comment the previously used values. New values may % be entered following the same syntax as the examples given. % % 1/07- function by R. Mapes, russ_mapes(a)hotmail.com xaxislabels= ['La'; 'Ce'; 'Pr'; 'Nd'; 'Pm'; 'Sm'; 'Eu'; 'Gd'; 'Tb'; 'Dy'; 'Ho'; 'Er'; 'Tm'; 'Yb'; 'Lu']; %normvals = [0.31 0.808 0.122 0.6 NaN 0.195 0.0735 0.259 0.0474 0.322 0.0718 0.21 0.0324 0.209 0.0322]; type = 'Chondrite'; %Boyton, 1984 %normvals = [31.1 67.033 7.9 30.4 NaN 5.98 1.253 5.5 0.85 5.54 1.04 3.275 0.5 3.113 0.456]; type = 'NASC'; %Gromet et al 1984 + Haskin et al., 1968 normvals=[30 64 7.1 26 NaN 4.5 0.88 3.8 0.64 3.5 0.8 2.3 0.33 2.2 0.32]; type = 'Upper Crust'; %Talor & McLennan, 1981 for k = 1:size(ree, 1) reenorm(k,:) = ree(k,:) ./ normvals; end %plot all data as lines for i = 1:size(reenorm,1) plotinfo=[1:15; reenorm(i,:)]; clear plotinfonew for j = 1:15 if j == 1 plotinfonew = plotinfo(:,1); hold on elseif isnan(plotinfo(2,j)) == 0 plotinfonew=[plotinfonew plotinfo(:,j)]; end end plot(plotinfonew(1,:), plotinfonew(2,:), strcat(linecolor(i),'-')); plot(plotinfonew(1,:), plotinfonew(2,:), strcat(linecolor(i),'o')); end %format plot set(gca, 'xtick', [1:15], 'xticklabel', [xaxislabels]) set(gca,'yscale', 'log') axis tight box on xlabel('REE'), ylabel(strcat('Sample/', type)) hold off %%%%%%%%% Uncomment to save Illustrator file %%%%%%%%% % If saveas command is uncommented the m-file will save an Adobe Illustrator file of the plot saveas(gcf, 'ree.ai','ai')