forum-msg-id-132049-edit

Original date:2018-02-27 13:09:35 Edited by: petelomax Subject: Re: Need an other phix explanation please

No problem, try this:

include pGUI.e 
include builtins\timedate.e 
 
constant factor = 1e-6, 
         dayone = parse_date_string("1/1/1999",{"D/M/YYYY"}), 
         oneday = timedelta(days:=1) 
 
procedure main() 
    IupOpen() 
 
    Ihandle plot = IupPlot("GRID=YES, MARGIN=80, AXS_XTICKROTATENUMBER=YES") 
     
    IupPlotBegin(plot,1) 
    for i=1 to 7000 do 
        timedate td = adjust_timedate(dayone,oneday*i) 
        IupPlotAddStr(plot, format_timedate(td,"DD/MM/YYYY"), factor*i*i*i+0.2) 
    end for 
    {} = IupPlotEnd(plot) 
 
    IupPlotBegin(plot,1) 
    for i=1 to 7000 do 
        timedate td = adjust_timedate(dayone,oneday*i) 
        integer j = 7000-i 
        IupPlotAddStr(plot, format_timedate(td,"DD/MM/YYYY"), factor*j*j*j+0.2) 
    end for 
    {} = IupPlotEnd(plot) 
 
    Ihandle dlg = IupDialog(plot) 
    IupSetAttributes(dlg, "RASTERSIZE=640x480") 
    IupSetAttribute(dlg, "TITLE", "temperature/moisture") 
    IupCloseOnEscape(dlg) 
    IupShow(dlg) 
 
    IupMainLoop() 
    IupClose() 
end procedure 
 
main() 

Regards,
Pete

EDIT: Sorry, I missed the part about two Y axis scales, but still it is probably an easier task to display a fake rhs one than write a full plotter. Perhaps set MARGINRIGHT and draw it in the POSTDRAW_CB.

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu