Hello everyone,
I want to use wxPlotCtrl or wxMathPlot to plot some scientific graphs, for example bode plots.
To do this properly it is necessary to have logarithmic scaled axis, but as far as i can see there is no way to realise this!?
Does anyone have an idea how to implement this in wxPlotCtrl or wxMathPlot?
Thank you
Greetings
wxPlotCtrl or wxMathPlot - Logarithmic axis
Re: wxPlotCtrl or wxMathPlot - Logarithmic axis
You can always plot (x, log10 (y)), but then the units of y will be log10 (y). You can get the correct labels using double a = log10 (Ymax / Ymin) / N; where you want N intervals between the ticks. The values to write will then be Ymin * pow (10.0, a*n) for the nth tick. n=0 gives Ymin and n=N gives Ymax. To use this, however, you will need to hide the y-axis and to draw the tick text yourself.