From 40224f48fb48d461984a011918a510851e258374 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 11 Aug 2016 14:41:14 +0200 Subject: [PATCH] Minor simulation plot style changes --- eeschema/sim/sim_plot_panel.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/eeschema/sim/sim_plot_panel.cpp b/eeschema/sim/sim_plot_panel.cpp index aa319abfa9..3f197b5125 100644 --- a/eeschema/sim/sim_plot_panel.cpp +++ b/eeschema/sim/sim_plot_panel.cpp @@ -109,9 +109,12 @@ int SIM_PLOT_PAINTER::Draw( mglGraph* aGraph ) { const std::vector& traces = m_parent->m_traces; const std::pair& axisRangeX = m_parent->m_axisRangeX; - std::pair axisRangeY = m_parent->m_axisRangeY; + const std::pair& axisRangeY = m_parent->m_axisRangeY; aGraph->Clf(); + //aGraph->SetPlotFactor( 1.5 ); + //aGraph->LoadFont( "termes" ); + aGraph->SetFontSize( 1.5 ); // Axis settings // Use autorange values if possible @@ -123,9 +126,8 @@ int SIM_PLOT_PAINTER::Draw( mglGraph* aGraph ) if( axisRangeY.first < axisRangeY.second ) { // Increase the Y axis range, so it is easy to read the extreme values - axisRangeY.first -= axisRangeY.second * 0.1; - axisRangeY.second += axisRangeY.second * 0.1; - aGraph->SetRange( 'y', axisRangeY.first, axisRangeY.second ); + double range = axisRangeY.second - axisRangeY.first; + aGraph->SetRange( 'y', axisRangeY.first - 0.1 * range, axisRangeY.second + 0.1 * range ); } else { @@ -147,7 +149,10 @@ int SIM_PLOT_PAINTER::Draw( mglGraph* aGraph ) } if( traces.size() ) + { + aGraph->SetFontSize( 2.5 ); aGraph->Legend( 1, "-#" ); // legend entries horizontally + draw a box around legend + } return 0; }