/dev/adei-asec

To get this branch, use:
bzr branch http://darksoft.org/webbzr/dev/adei-asec

« back to all changes in this revision

Viewing changes to classes/views/spectrumview.php

  • Committer: Artur Reymers
  • Date: 2014-08-15 17:40:49 UTC
  • Revision ID: remoart@gmail.com-20140815174049-1petqatw8i6k3xfe
Fix: Log Scale for Negative values

Show diffs side-by-side

added added

removed removed

Lines of Context:
232
232
        $graph->img->SetMargin(55,5,10,20);
233
233
 
234
234
        if(!$scale_log) $graph->SetScale("textlin",0,$max_of_y);
235
 
        else $graph->SetScale("textlog");
 
235
        else if( min($x_bin) >= 0 ) $graph->SetScale("textlog");
 
236
        else {
 
237
            $graph->SetScale("textlin",0,$max_of_y);
 
238
            $x_bin = array_fill(0, $bins_n, 1);
 
239
            $txt = new Text();
 
240
            $txt->SetFont(FF_ARIAL,FS_NORMAL,15);
 
241
            $txt->Set("Negative data values\ncan not be used\nin a log scale.");
 
242
            $txt->SetParagraphAlign('center');
 
243
            $txt->SetPos(0.5,0.3,'center');
 
244
            $txt->SetBox('lightyellow');
 
245
            $txt->SetShadow();
 
246
            $graph->Add($txt);
 
247
        }
 
248
 
236
249
        $graph->xaxis->SetPos("min");
237
250
        $graph->yaxis->SetPos("min");
238
251
        $graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,8);