Your plotfunction is only real if the Log-arguments are `>0`. Perhaps using RegionFunctions might help solving your problem: Plot[ Log[27, Sin[2*x] - 1/3*Cos[x]] - 1/3*Log[3, -Cos[x]] , {x, -Pi,Pi}, PlotRange -> All, RegionFunction ->Function[x, (Sin[2*x] - 1/3*Cos[x] > 0) && ( -Cos[x] > 0)],PlotRange -> All] [![enter image description here][1]][1] [1]: https://i.sstatic.net/q6H2x.jpg