wxmaxima

How to plot a bode_gain inside the wxmaxima GUI?


I'm unable to plot a bode_gain inside the GUI of wxmaxima, I know that for example, "wxplot" plots inside the GUI but putting the prefix on bode_gain function doesn't work for me, so

Can someone help me by telling me how to plot a bode_gain function inside wxmaxima GUI instead of using a new graphic window?


Solution

  • On looking at the code (share/contrib/bode.mac), I see there's no provision to call different plotting functions, it's always the built-in plot2d. For wxMaxima it's nice to be able to use wxplot2d since that makes embedded plots.

    Here's a way to replace the call to plot2d in the definition of bode_gain and bode_phase.

    load ("bode.mac");
    ''(subst (plot2d = wxplot2d, fundef (bode_gain)));
    ''(subst (plot2d = wxplot2d, fundef (bode_phase)));
    

    Note carefully the first two characters are two single quotes, not a double quote. The quote-quote '' has the effect of evaluating the modified function definition, constructed by subst, from the existing function definition returned by fundef.

    A different way is to find bode.mac in your installation, and edit the file to say wxplot2d instead of plot2d wherever the latter appears.

    I will update bode.mac so that the plotting function is more easily changed, and that new version will appear in future releases (5.46 is the next one) of Maxima.