I have a compiled function which I can plot without issue using Plot
. However, when I use LogLinearPlot
I get the message:
Argument x at position 1 should be a machine-size real number.
The following MWE gets the same message:
compFn = Compile[{{x, _Real}}, x^2 + 2]
LogLinearPlot[compFn[x], {x, 1, 100}]
Ultimately my goal is to plot the function with a logarithmic scale for the $ x $-axis.
Plot[cf[x], {x, 0, 100}, ScalingFunctions -> {{Log, Exp}, None}]
? $\endgroup$Plot[cf[Exp@x], {x, Log@1, Log@100}, Ticks -> {Charting`ScaledTicks[{Log, Exp}], Automatic}]
? $\endgroup$Clear[x]
. BTW, your code runs no warning and no error on my side. $\endgroup$