[Kst] kdeextragear-2/kst/kst

Barth Netterfield netterfield at astro.utoronto.ca
Sat Mar 5 22:29:20 CET 2005


CVS commit by netterfield: 

New rules for default labels for curves:
-get rid of file name in top label - it is generally not useful.
-For 1-3 curves, v->label() in Y axes, otherwise, default to legend box on.


  M +10 -7     kst2dplot.cpp   1.368
  M +4 -0      kstpsd.cpp   1.22
  M +2 -1      kstvcurve.cpp   1.59
  M +2 -1      main.cpp   1.100


--- kdeextragear-2/kst/kst/kst2dplot.cpp  #1.367:1.368
@@ -2495,4 +2495,6 @@ void Kst2DPlot::GenerateDefaultLabels() 
 
     i_count = ylabels.count();
+    if (i_count<4) { // only fill if there are 1, 2 or 3 different label....
+      // otherwise a legend box should be used.
     for (i_curve = 0; i_curve < i_count; i_curve++) {
       if (i_curve == i_count - 1) {
@@ -2505,4 +2507,5 @@ void Kst2DPlot::GenerateDefaultLabels() 
     }
   }
+  }
 
   // labels for images

--- kdeextragear-2/kst/kst/kstpsd.cpp  #1.21:1.22
@@ -318,4 +318,8 @@ KstObject::UpdateType KstPSD::update(int
     _Freq = 1.0;
   }
+
+  (*_sVector)->setLabel(i18n("PSD [%1/sqrt(%2)]").arg(VUnits).arg(RUnits));
+  (*_fVector)->setLabel(i18n("Frequency [%1]").arg(RUnits));
+
   (*_sVector)->update(update_counter);
   (*_fVector)->update(update_counter);

--- kdeextragear-2/kst/kst/kstvcurve.cpp  #1.58:1.59
@@ -443,5 +443,6 @@ QString KstVCurve::yLabel() const {
 
 QString KstVCurve::topLabel() const {
-  return VY->fileLabel();
+  return QString::null;
+  //return VY->fileLabel();
 }
 

--- kdeextragear-2/kst/kst/main.cpp  #1.99:1.100
@@ -667,5 +667,6 @@ int main(int argc, char *argv[]) {
         plot = *plist.at(i_plot);
         plot->GenerateDefaultLabels();
-        if (in.dolegend) {
+        if ((plot->Curves.count()>3) ||
+            (in.dolegend)) {
           plot->Legend->setShow(true);
           plot->Legend->setFront(true);




More information about the Kst mailing list