Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

drawing the function y = |log x|

When drawing the function y = |log x|, I know that x must be positive but I have varied x from -5 to 5 by habit. I had no error message and a graph having a part in the box x<0. I would have liked to attach the graphic but that is denied me.

    def y(x):
        return abs(log(x))

    G = plot(y, (-5,5), color='blue')
    G.show(aspect_ratio=1, axes = True, gridlines=True, ymin = -1, ymax = 6)