Grid solid at label points

Help
andrewd
2010-01-08
2013-05-02
  • andrewd

    andrewd - 2010-01-08

    The dotted grid is useful, but it is not immediately obvious where the label refers to. A little look at the code shows the mid-point of the label corresponds to the reported value. To highlight this I changed my copy to draw that grid line as solid. It entailed copying some lines from the grid-drawing loop, into label drawing loop and setting the pen wxSOLID. Specifially:

    if (m_ticks) { // draw axis ticks
    if (m_flags == mpALIGN_BORDER_BOTTOM)
    dc.DrawLine( p, orgy, p, orgy-4);
    else
    dc.DrawLine( p, orgy, p, orgy+4);
    } else { // draw grid dotted lines
    m_pen.SetStyle(wxSOLID);
    dc.SetPen(m_pen);
    if ((m_flags == mpALIGN_BOTTOM) && !m_drawOutsideMargins) {
    dc.DrawLine( p, orgy+4, p, minYpx );
    } else {
    if ((m_flags == mpALIGN_TOP) && !m_drawOutsideMargins) {
    dc.DrawLine( p, orgy-4, p, maxYpx );
    } else {
    dc.DrawLine( p, 0/*-w.GetScrY()*/, p, w.GetScrY() );
    }
    }
    m_pen.SetStyle(wxSOLID);
    dc.SetPen(m_pen);
    }

    is inserted after line 884 in mathplot.cpp however it might be optimized a bit further.

     
  • andrewd

    andrewd - 2010-01-08

    This was of course on the x-axis only, as the y-axis is visually obvious anyway.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks