Commit f4f4fdcc8c44b7e66907b6919e46423fcfb78bcd

Authored by Erdogan Furkan
1 parent 128f2bdb

Done

src/ParamOutputImpl/Plot/InstantPlot/PlotFunction.cc
@@ -319,10 +319,6 @@ namespace plot @@ -319,10 +319,6 @@ namespace plot
319 Label label(lYAxis->_legend.getFont(), compLegendColor); 319 Label label(lYAxis->_legend.getFont(), compLegendColor);
320 label._text = unit; 320 label._text = unit;
321 lYAxis->_legend.pushLabel(label); 321 lYAxis->_legend.pushLabel(label);
322 - Color white(255, 255, 255);  
323 - Label emptyLabel(lYAxis->_legend.getFont(), white);  
324 - emptyLabel._text = " ";  
325 - lYAxis->_legend.pushLabel(emptyLabel);  
326 } 322 }
327 } 323 }
328 } 324 }
src/ParamOutputImpl/Plot/PanelPlotOutput.cc
@@ -536,6 +536,9 @@ namespace plot @@ -536,6 +536,9 @@ namespace plot
536 lSavedColor = changeColor(_pls, line.second, _panel->_page->_mode); 536 lSavedColor = changeColor(_pls, line.second, _panel->_page->_mode);
537 } 537 }
538 _pls->mtex(getPlSide(pAxis->_position).c_str(), lPosition, 0.5, 0.5, lineToDraw.c_str()); 538 _pls->mtex(getPlSide(pAxis->_position).c_str(), lPosition, 0.5, 0.5, lineToDraw.c_str());
  539 + // Adding more height if needed
  540 + addSpaceForExInd(lineToDraw, lPosition);
  541 +
539 lPosition += (1 + PlPlotUtil::LINE_SPACE_TITLE); 542 lPosition += (1 + PlPlotUtil::LINE_SPACE_TITLE);
540 if (line.second.isSet()) 543 if (line.second.isSet())
541 { 544 {
@@ -574,6 +577,9 @@ namespace plot @@ -574,6 +577,9 @@ namespace plot
574 lSavedColor = changeColor(_pls, line.second, _panel->_page->_mode); 577 lSavedColor = changeColor(_pls, line.second, _panel->_page->_mode);
575 } 578 }
576 _pls->mtex(getPlSide(pAxis->_position).c_str(), lPosition, 0.5, 0.5, lineToDraw.c_str()); 579 _pls->mtex(getPlSide(pAxis->_position).c_str(), lPosition, 0.5, 0.5, lineToDraw.c_str());
  580 + // Adding more height if needed
  581 + addSpaceForExInd(lineToDraw, lPosition);
  582 +
577 lPosition += (1 + PlPlotUtil::LINE_SPACE_TITLE); 583 lPosition += (1 + PlPlotUtil::LINE_SPACE_TITLE);
578 if (line.second.isSet()) 584 if (line.second.isSet())
579 { 585 {
@@ -613,6 +619,9 @@ namespace plot @@ -613,6 +619,9 @@ namespace plot
613 lSavedColor = changeColor(_pls, line.second, _panel->_page->_mode); 619 lSavedColor = changeColor(_pls, line.second, _panel->_page->_mode);
614 } 620 }
615 _pls->mtex(getPlSide(pAxis->_position).c_str(), lPosition, 0.5, 0.5, lineToDraw.c_str()); 621 _pls->mtex(getPlSide(pAxis->_position).c_str(), lPosition, 0.5, 0.5, lineToDraw.c_str());
  622 + // Adding more height if needed
  623 + addSpaceForExInd(lineToDraw, lPosition);
  624 +
616 lPosition += (1 + PlPlotUtil::LINE_SPACE_TITLE); 625 lPosition += (1 + PlPlotUtil::LINE_SPACE_TITLE);
617 if (line.second.isSet()) 626 if (line.second.isSet())
618 { 627 {
@@ -653,6 +662,9 @@ namespace plot @@ -653,6 +662,9 @@ namespace plot
653 lSavedColor = changeColor(_pls, line.second, _panel->_page->_mode); 662 lSavedColor = changeColor(_pls, line.second, _panel->_page->_mode);
654 } 663 }
655 _pls->mtex(getPlSide(pAxis->_position).c_str(), lPosition, 0.5, 0.5, lineToDraw.c_str()); 664 _pls->mtex(getPlSide(pAxis->_position).c_str(), lPosition, 0.5, 0.5, lineToDraw.c_str());
  665 + // Adding more height if needed
  666 + addSpaceForExInd(lineToDraw, lPosition);
  667 +
656 lPosition += (1 + PlPlotUtil::LINE_SPACE_TITLE); 668 lPosition += (1 + PlPlotUtil::LINE_SPACE_TITLE);
657 if (line.second.isSet()) 669 if (line.second.isSet())
658 { 670 {
@@ -681,6 +693,18 @@ namespace plot @@ -681,6 +693,18 @@ namespace plot
681 } 693 }
682 } 694 }
683 695
  696 + void PanelPlotOutput::addSpaceForExInd(std::string &legend, double &lPosition){
  697 + if(legend != ""){
  698 +
  699 + // We check if there is an exponent or an indice
  700 + const char *exponent = std::strstr(legend.c_str(), "#u");
  701 + const char *indice = std::strstr(legend.c_str(), "#d");
  702 +
  703 + if(exponent || indice)
  704 + lPosition += 1;
  705 + }
  706 + }
  707 +
684 void PanelPlotOutput::drawAxis(boost::shared_ptr<Axis> pAxis, TickConf &pTickConf, 708 void PanelPlotOutput::drawAxis(boost::shared_ptr<Axis> pAxis, TickConf &pTickConf,
685 std::string pXAxisOptions, std::string pYAxisOptions) 709 std::string pXAxisOptions, std::string pYAxisOptions)
686 { 710 {
src/ParamOutputImpl/Plot/PanelPlotOutput.hh
@@ -427,6 +427,14 @@ protected: @@ -427,6 +427,14 @@ protected:
427 virtual void drawLegends(boost::shared_ptr<Axis>& pAxis, PlWindow& pPlWindow, Bounds& pPlotAreaSize); 427 virtual void drawLegends(boost::shared_ptr<Axis>& pAxis, PlWindow& pPlWindow, Bounds& pPlotAreaSize);
428 428
429 /** 429 /**
  430 + * @brief Add space if there is an exponent or indice
  431 + *
  432 + * @param legend legend to check
  433 + * @param lPosition position to modify
  434 + */
  435 + void addSpaceForExInd(std::string &legend, double &lPosition);
  436 +
  437 + /**
430 * @brief Draw parameters legend. 438 * @brief Draw parameters legend.
431 */ 439 */
432 virtual void drawParamsLegend(void); 440 virtual void drawParamsLegend(void);