tchange order of plots - cosmo - front and backend for Markov-Chain Monte Carlo inversion of cosmogenic nuclide concentrations
 (HTM) git clone git://src.adamsgaard.dk/cosmo
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 8e3cc4590beecfd983f4e35ea257067e04a4a948
 (DIR) parent e888c6b7052f8983f6b241eb7e5fae0e1a6a564f
 (HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
       Date:   Mon,  9 Nov 2015 18:37:10 +0100
       
       change order of plots
       
       Diffstat:
         M index.php                           |      16 ++++++++--------
         M matlab/generate_plots.m             |     156 +++++++++++++++++--------------
       
       2 files changed, 94 insertions(+), 78 deletions(-)
       ---
 (DIR) diff --git a/index.php b/index.php
       t@@ -76,7 +76,7 @@ if (isset($_GET['wait_id']) && !empty($_GET['wait_id'])) {
                        <div class="card">
                          <div class="card-image">
                          <img src="output/<?php
       -                        echo($_GET['results_id']); ?>_Walks-7.png">
       +                        echo($_GET['results_id']); ?>_Walks-6.png">
                                <span class="card-title blue-text text-darken-2">
                                    Generalized model parameter values</span>
                          </div>
       t@@ -96,13 +96,13 @@ if (isset($_GET['wait_id']) && !empty($_GET['wait_id'])) {
                          </div>
                          <div class="card-action">
                          <a href="output/<?php
       -                        echo($_GET['results_id']); ?>_Walks-7.png"
       +                        echo($_GET['results_id']); ?>_Walks-6.png"
                            target="_blank">Link to PNG</a>
                          <a href="output/<?php
       -                        echo($_GET['results_id']); ?>_Walks-7.pdf"
       +                        echo($_GET['results_id']); ?>_Walks-6.pdf"
                            target="_blank">Link to PDF</a>
                          <a href="output/<?php
       -                        echo($_GET['results_id']); ?>_Walks-7.fig"
       +                        echo($_GET['results_id']); ?>_Walks-6.fig"
                            target="_blank">Link to FIG</a>
                          </div>
                        </div>
       t@@ -152,7 +152,7 @@ if (isset($_GET['wait_id']) && !empty($_GET['wait_id'])) {
                        <div class="card">
                          <div class="card-image">
                          <img src="output/<?php
       -                        echo($_GET['results_id']); ?>_Walks-6.png">
       +                        echo($_GET['results_id']); ?>_Walks-7.png">
                                <span class="card-title blue-text text-darken-2">
                                    Erosion history</span>
                          </div>
       t@@ -169,13 +169,13 @@ if (isset($_GET['wait_id']) && !empty($_GET['wait_id'])) {
                          </div>
                          <div class="card-action">
                          <a href="output/<?php
       -                        echo($_GET['results_id']); ?>_Walks-6.png"
       +                        echo($_GET['results_id']); ?>_Walks-7.png"
                            target="_blank">Link to PNG</a>
                          <a href="output/<?php
       -                        echo($_GET['results_id']); ?>_Walks-6.pdf"
       +                        echo($_GET['results_id']); ?>_Walks-7.pdf"
                            target="_blank">Link to PDF</a>
                          <a href="output/<?php
       -                        echo($_GET['results_id']); ?>_Walks-6.fig"
       +                        echo($_GET['results_id']); ?>_Walks-7.fig"
                            target="_blank">Link to FIG</a>
                          </div>
                        </div>
 (DIR) diff --git a/matlab/generate_plots.m b/matlab/generate_plots.m
       t@@ -250,76 +250,6 @@ end
        
        
        
       -%% Plot d18O curve, from PlotSmoothZachos.m
       -fh = [fh;figure('visible', show_figures)];
       -
       -if strcmp(record, 'rec_5kyr')
       -    d18O_filename = 'lisiecki_triinterp_2p6Ma_5ky.mat'; %  zachos_triinterp_2p6Ma
       -elseif strcmp(record, 'rec_20kyr')
       -    d18O_filename = 'lisiecki_triinterp_2p6Ma_20ky.mat'; %  zachos_triinterp_2p6Ma
       -elseif strcmp(record, 'rec_30kyr')
       -    d18O_filename = 'lisiecki_triinterp_2p6Ma_30ky.mat'; %  zachos_triinterp_2p6Ma
       -else
       -    error(['record ' record ' not understood']);
       -end
       -
       -load([matlab_scripts_folder, d18O_filename])
       -xs = ti;
       -dt = diff(ti(1:2));
       -ys = d18O_triang;
       -%colpos = [0.5,0.5,1];
       -colpos = [0,0,1];
       -%colneg = [0.5,1,0.5];
       -colneg = [1,0,0];
       -midvalue = 3.75;  %%% THIS IS THE THRESHOLD
       -axh(1)=subplot(3,1,1);
       -[~,~,~,i_cross]=fill_red_blue(xs,ys,colpos,colneg,midvalue);
       -ylabel('\delta18O')
       -axis tight
       -axis([-0.1,2.7,3.0,5.2])
       -%axis([-0.05,0.3,3.0,5.2])
       -xlim([-0.1,2.7])
       -%xlim([-0.05,0.3])
       -hold on
       -%plot(A(:,1)/1000,A(:,2),'.-m')
       -axis ij
       -xs_cross = (i_cross-1)*dt;
       -xs_cross = [0;xs_cross];
       -%title([fn,'.  minrad = ',num2str(minrad),' Ma'],'interp','none')
       -
       -xs_cross(2) = 0.011;
       -
       -axh(2)=subplot(3,1,2);
       -stairs(xs_cross,(1+-1*(-1).^(1:length(xs_cross)))/2,'b','linewidth',1.5);
       -hold on
       -start1 = [xs_cross(end),2.7];
       -start2 = [1,1];
       -plot(start1,start2,'b','linewidth',1.5);
       -%title('Exposure. 0 = glaciated, 1 = not glaciated')
       -axis([-0.1,2.7,-0.5,1.5])
       -%axis([-0.05,0.3,-0.5,1.5])
       -xlabel('Age BP [Ma]')
       -
       -axh(2)=subplot(3,1,3);
       -stairs(xs_cross,(1+-1*(-1).^(1:length(xs_cross)))/2,'r','linewidth',1.5);
       -hold on
       -plot(start1,start2,'r','linewidth',1.5);
       -%title('Exposure. 0 = glaciated, 1 = not glaciated')
       -axis([-0.1,2.7,-1,2])
       -%axis([-0.05,0.3,-1,2])
       -xlabel('Age BP [Ma]')
       -
       -
       -hold on
       -d18Oth = midvalue;
       -ErateInt=1e-6; ErateGla=1e-7;
       -[~,~] = ExtractHistory2(ti,d18O_triang,d18Oth,ErateInt,ErateGla);
       -
       -linkaxes(axh,'x')
       -% stairs(-tStarts,relExpos+2,'r')
       -
       -
       -
        %% Plot one histogram per model parameter, including data from all walkers
        fh = [fh;figure('visible', show_figures)];
        for i1 = 1:M % for each model parameter
       t@@ -339,6 +269,19 @@ for i1 = 1:M % for each model parameter
            % 2nd quartile = median = 50th percentile
            med = median(data);
            plot([med, med], get(gca,'YLim'), 'm-')
       +    
       +    % save median values for later
       +    if i1 == 1
       +        epsilon_int_med = med;
       +    elseif i1 == 2
       +        epsilon_gla_med = med;
       +    elseif i1 == 3
       +        t_degla_med = med;
       +    elseif i1 == 4
       +        record_threshold_med = med;
       +    else
       +        error('Unknown parametr');
       +    end
            %ylims = get(gca,'YLim');
            %text(med, ylims(1) + (ylims(2) - ylims(1))*0.9, ...
                %['\leftarrow' num2str(med)]);
       t@@ -389,6 +332,79 @@ for i1 = 1:M % for each model parameter
        end
        
        
       +
       +
       +%% Plot d18O curve, from PlotSmoothZachos.m
       +fh = [fh;figure('visible', show_figures)];
       +
       +if strcmp(record, 'rec_5kyr')
       +    d18O_filename = 'lisiecki_triinterp_2p6Ma_5ky.mat'; %  zachos_triinterp_2p6Ma
       +elseif strcmp(record, 'rec_20kyr')
       +    d18O_filename = 'lisiecki_triinterp_2p6Ma_20ky.mat'; %  zachos_triinterp_2p6Ma
       +elseif strcmp(record, 'rec_30kyr')
       +    d18O_filename = 'lisiecki_triinterp_2p6Ma_30ky.mat'; %  zachos_triinterp_2p6Ma
       +else
       +    error(['record ' record ' not understood']);
       +end
       +
       +load([matlab_scripts_folder, d18O_filename])
       +xs = ti;
       +dt = diff(ti(1:2));
       +ys = d18O_triang;
       +%colpos = [0.5,0.5,1];
       +colpos = [0,0,1];
       +%colneg = [0.5,1,0.5];
       +colneg = [1,0,0];
       +%midvalue = 3.75;  %%% THIS IS THE THRESHOLD
       +midvalue = record_threshold_med;
       +axh(1)=subplot(3,1,1);
       +[~,~,~,i_cross]=fill_red_blue(xs,ys,colpos,colneg,midvalue);
       +ylabel('\delta18O')
       +axis tight
       +axis([-0.1,2.7,3.0,5.2])
       +%axis([-0.05,0.3,3.0,5.2])
       +xlim([-0.1,2.7])
       +%xlim([-0.05,0.3])
       +hold on
       +%plot(A(:,1)/1000,A(:,2),'.-m')
       +axis ij
       +xs_cross = (i_cross-1)*dt;
       +xs_cross = [0;xs_cross];
       +%title([fn,'.  minrad = ',num2str(minrad),' Ma'],'interp','none')
       +
       +xs_cross(2) = 0.011;
       +
       +axh(2)=subplot(3,1,2);
       +stairs(xs_cross,(1+-1*(-1).^(1:length(xs_cross)))/2,'b','linewidth',1.5);
       +hold on
       +start1 = [xs_cross(end),2.7];
       +start2 = [1,1];
       +plot(start1,start2,'b','linewidth',1.5);
       +%title('Exposure. 0 = glaciated, 1 = not glaciated')
       +axis([-0.1,2.7,-0.5,1.5])
       +%axis([-0.05,0.3,-0.5,1.5])
       +xlabel('Age BP [Ma]')
       +
       +axh(2)=subplot(3,1,3);
       +stairs(xs_cross,(1+-1*(-1).^(1:length(xs_cross)))/2,'r','linewidth',1.5);
       +hold on
       +plot(start1,start2,'r','linewidth',1.5);
       +%title('Exposure. 0 = glaciated, 1 = not glaciated')
       +axis([-0.1,2.7,-1,2])
       +%axis([-0.05,0.3,-1,2])
       +xlabel('Age BP [Ma]')
       +
       +
       +hold on
       +d18Oth = midvalue;
       +ErateInt=1e-6; ErateGla=1e-7;
       +[~,~] = ExtractHistory2(ti,d18O_triang,d18Oth,ErateInt,ErateGla);
       +
       +linkaxes(axh,'x')
       +% stairs(-tStarts,relExpos+2,'r')
       +
       +
       +
        %% position figure windows at certain coordinates on the screen
        if strcmp(show_figures, 'on')
            figpos1 = [6         474        1910         504];