Resize of a simple plot

Help
jimmigoo
2009-03-30
2013-05-02
  • jimmigoo

    jimmigoo - 2009-03-30

    Hi everybody!

    I'm a newbie of wxMathPlot,
    it's my first day with it,
    and I'd like to ask for some questions, because I really don't know how to go on...

    I'd like to insert the following code onto a Tab panel created into a wxAuiNotebook panel,
    and I choose to copy in the right place the whole code of example1.

    I compile everything in the right way, but when I'll see my GUI with the wxMathPlot canvas,
    I read everytime this box:

    MATHPLOT INFORMATION
    mpScaleX::Plot: n_label = 1400.000000 -> p_label = 550

    It seems like the plot would like to go on, over the real size dimensions (600x400 pixel),
    and this box continues to appear if I press the OK button.

    I'd like to know how to plot the graph like in this screenshot
    http://wxmathplot.sourceforge.net/immagini/wxmp12.png

    with the possibility to put the origins of X and Y scale NOT at the very TOP-LEFT of the mpWindow,
    and how to plot without the appearance of the box previously described.

    I'm look forward for read your reply.

    Best regards,

    Francesco

    Attached code:

       mpLayer* l;

        wxFont graphFont(11, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
        m_plot = new mpWindow( Tab1, -1, wxPoint(0,0), wxSize(600,400), wxSUNKEN_BORDER );
        mpScaleX* xaxis = new mpScaleX(wxT("X"), mpALIGN_BOTTOM, false, mpX_NORMAL);
        mpScaleY* yaxis = new mpScaleY(wxT("Y"), mpALIGN_LEFT, false);
        xaxis->SetFont(graphFont);
        yaxis->SetFont(graphFont);
        xaxis->SetDrawOutsideMargins(false);
        yaxis->SetDrawOutsideMargins(false);
        m_plot->SetMargins(0, 600, 50,0);
        m_plot->SetPos(300,200);
        m_plot->SetScaleX(0.5);
        m_plot->SetScaleY(0.5);
         m_plot->SetMargins(50, 50, 200, 150);
        m_plot->AddLayer(     xaxis );
        m_plot->AddLayer(     yaxis );
        m_plot->AddLayer(     new MySIN( 10.0, 220.0 ) );
        m_plot->AddLayer(     new MyCOSinverse( 10.0, 100.0 ) );
        m_plot->AddLayer( l = new MyLissajoux( 125.0 ) );

        m_plot->Fit();
        m_plot->AddLayer(     new mpText(wxT("mpText sample"), 10, 10) );
        wxBrush hatch(wxColour(200,200,200), wxSOLID);
    m_plot->AddLayer( nfo = new mpInfoLayer(wxRect(80,20,40,40), &hatch));
       m_plot->AddLayer( nfo = new mpInfoCoords(wxRect(80,20,10,10), &hatch));
       nfo->SetVisible(false);
        wxBrush hatch2(wxColour(163,208,212), wxSOLID);
        mpInfoLegend* leg;
        m_plot->AddLayer( leg = new mpInfoLegend(wxRect(200,20,40,40), &hatch2));
        leg->SetVisible(true);
       
         m_plot->EnableCoordTooltip(true);
         set a nice pen for the lissajoux
        wxPen mypen(*wxRED, 5, wxSOLID);
       l->SetPen( mypen);

     
    • jimmigoo

      jimmigoo - 2009-04-03

      I've understood what the mistake was....

      I apologize..

      :)

      Bye

      Francesco

       

Log in to post a comment.