Minor simulation plot style changes

This commit is contained in:
Maciej Suminski 2016-08-11 14:41:14 +02:00
parent 781a12222c
commit 40224f48fb
1 changed files with 9 additions and 4 deletions

View File

@ -109,9 +109,12 @@ int SIM_PLOT_PAINTER::Draw( mglGraph* aGraph )
{ {
const std::vector<SIM_PLOT_PANEL::TRACE>& traces = m_parent->m_traces; const std::vector<SIM_PLOT_PANEL::TRACE>& traces = m_parent->m_traces;
const std::pair<double, double>& axisRangeX = m_parent->m_axisRangeX; const std::pair<double, double>& axisRangeX = m_parent->m_axisRangeX;
std::pair<double, double> axisRangeY = m_parent->m_axisRangeY; const std::pair<double, double>& axisRangeY = m_parent->m_axisRangeY;
aGraph->Clf(); aGraph->Clf();
//aGraph->SetPlotFactor( 1.5 );
//aGraph->LoadFont( "termes" );
aGraph->SetFontSize( 1.5 );
// Axis settings // Axis settings
// Use autorange values if possible // Use autorange values if possible
@ -123,9 +126,8 @@ int SIM_PLOT_PAINTER::Draw( mglGraph* aGraph )
if( axisRangeY.first < axisRangeY.second ) if( axisRangeY.first < axisRangeY.second )
{ {
// Increase the Y axis range, so it is easy to read the extreme values // Increase the Y axis range, so it is easy to read the extreme values
axisRangeY.first -= axisRangeY.second * 0.1; double range = axisRangeY.second - axisRangeY.first;
axisRangeY.second += axisRangeY.second * 0.1; aGraph->SetRange( 'y', axisRangeY.first - 0.1 * range, axisRangeY.second + 0.1 * range );
aGraph->SetRange( 'y', axisRangeY.first, axisRangeY.second );
} }
else else
{ {
@ -147,7 +149,10 @@ int SIM_PLOT_PAINTER::Draw( mglGraph* aGraph )
} }
if( traces.size() ) if( traces.size() )
{
aGraph->SetFontSize( 2.5 );
aGraph->Legend( 1, "-#" ); // legend entries horizontally + draw a box around legend aGraph->Legend( 1, "-#" ); // legend entries horizontally + draw a box around legend
}
return 0; return 0;
} }