From 30c0415b7b343003ceb2d85da90805a05c508fae Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de> Date: Mon, 26 Oct 2015 09:43:56 +0100 Subject: [PATCH] layout --- pub/lib/plot.cpp | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/pub/lib/plot.cpp b/pub/lib/plot.cpp index 77a28ef8..c04618b7 100644 --- a/pub/lib/plot.cpp +++ b/pub/lib/plot.cpp @@ -147,9 +147,8 @@ int plot_data( CPlot* plot, ROld fd, int k, int j, int pstyle ) if ( !plot->Y.force ) continue; } - if ( np==plot->maxpoints && np<n ) { + if ( np==plot->maxpoints && np<n ) cout << "reached maxpoints at " << s->x[i] << "\n"; - } xp.push_back( x ); yp.push_back( y ); if ( s->has_dy() ) @@ -203,8 +202,7 @@ int plot_curve_convolved( CPlot* plot, ROlc fc, int k, int j, int cstyle ) yo.push_back( yp ); } if ( xo.size()==0 ){ - cout << "curve k="<<S(k)<<", j="<<S(j)<< - " has no points in plot window\n"; + cout << "curve k="<<S(k)<<", j="<<S(j)<< " has no points in plot window\n"; } plot->add_spec( true, true, cstyle, xo, yo, novec, fc->V[j]->z_str(), fc->xco.str_std(), fc->yco.str_std(), @@ -285,8 +283,7 @@ int plot_curve_refine( CPlot* plot, ROlc fc, int k, int j, int cstyle ) if ( !xc.size() ){ if ( !iref ) throw S("BUG: plot_curve_refine called with xc.size()=0"); - else - break; // regular exit + break; // regular exit } // evaluate curve for grid xc: RObjVecDbl cu = PCAST<const CObjVecDbl>( fc->eval_curve( xc, k, j, false ) ); @@ -322,11 +319,6 @@ int plot_curve_refine( CPlot* plot, ROlc fc, int k, int j, int cstyle ) } xn = xa; yn = ya; } - // cout << "DEB merger -> " << xn.size() << "\n"; - // for ( int i=0; i<xn.size(); ++i ) - // printf ("DEB xn yn %12.6g %12.6g\n", xn[i], yn[i] ); - - // end of loop if ( iref>=10 || xn.size()>=plot->maxpoints ) break; // alternate exit: too many refinements or too many points @@ -354,9 +346,6 @@ int plot_curve_refine( CPlot* plot, ROlc fc, int k, int j, int cstyle ) xa.push_back( xn.back() ); ya.push_back( yn.back() ); xn = xa; yn = ya; - // cout << "DEB within frame -> " << xn.size() << "\n"; - // for ( int i=0; i<xn.size(); ++i ) - // printf ("DEB xy %12.6g %12.6g\n", xn[i], yn[i] ); // set additional base points: bool insert_next = false; @@ -368,22 +357,17 @@ int plot_curve_refine( CPlot* plot, ROlc fc, int k, int j, int cstyle ) (xn[i+1]-xn[i-1]); if ( !plot->Y.close_enough( yn[i], yi, 0.005 ) ) { xc.push_back( (xn[i-1] + xn[i])/2 ); - // cout << "DEB disc " << xc.back() << "\n"; insert_next = true; continue; } } if ( insert_next ) { xc.push_back( (xn[i-1] + xn[i])/2 ); - // cout << "DEB next " << xc.back() << "\n"; insert_next = false; continue; } - if ( ( plot->Y.contains(yn[i]) && - !plot->Y.contains(yn[i-1]) ) || - ( !plot->Y.contains(yn[i]) && - plot->Y.contains(yn[i-1]) ) ) { - // cout << "DEB edge " << xc.back() << "\n"; + if ( ( plot->Y.contains(yn[i]) && !plot->Y.contains(yn[i-1]) ) || + ( !plot->Y.contains(yn[i]) && plot->Y.contains(yn[i-1]) ) ) { xc.push_back( (xn[i-1] + xn[i])/2 ); continue; } @@ -407,7 +391,6 @@ int plot_curve_refine( CPlot* plot, ROlc fc, int k, int j, int cstyle ) if ( !plot->Y.contains(yn[i]) || i==xn.size()-1 ) { npts += xa.size(); if ( xa.size() ){ - // cout << "DEB segment -> " << xa.size() << "\n"; plot->add_spec( true, first_seg, cstyle, xa, ya, novec, fc->V[j]->z_str(), fc->xco.str_std(), fc->yco.str_std(), @@ -490,7 +473,6 @@ void NPlot::plot( class CPlot *plot, bool add, const string& mode ) if ( fd ) { if ( !plot_data( plot, fd, k, j, pstyle ) ) continue; - } else if ( fc ) { if ( fc->kconv!=-1 ) { if ( !plot_curve_convolved( plot, fc, k, j, cstyle ) ) @@ -505,10 +487,8 @@ void NPlot::plot( class CPlot *plot, bool add, const string& mode ) if ( !plot_curve_refine( plot, fc, k, j, cstyle ) ) continue; } - - } else { + } else throw S("PROGRAM ERROR plot: unexpected file type"); - } if ( fd ) { plot->doc_PtTxLine( " " + f->info_line( j ), pstyle ); -- GitLab