Stack Exchange
Error in manim TypeError: LinearGradient.__new__() takes exactly 4 arguments (2 given)
from manim import *


class Solids(ThreeDScene):
    def construct(self):

        x_min, x_max, x_step = 0, 5, 1
        y_min, y_max, y_step = -5, 5, 1
        z_max, z_min, z_step = -5, 5, 1
        axes = ThreeDAxes(
            x_range=[x_min, x_max + x_step, x_step],
            y_range=[y_min, y_max + y_step, y_step],
            z_range=[z_min, z_max + z_step, z_step],)

        function = axes.plot(lambda x: np.sqrt(
            x), color=YELLOW, x_range=[0, 5])
        area = axes.get_area(function, x_range=[0, 5], color=BLUE)

        rec = axes.get_riemann_rectangles(function, dx=0.2, x_range=[
            1, 1.2], input_sample_type="left", stroke_width=0.5, fill_opacity=0.75, color=BLUE)
        rec_label = Text("dx", font_size=20)
        rec_label.next_to(rec, DOWN, buff=0,)

        group = VGroup(function, area, rec)
        # parametric surface of sqrt of x but in 3d roatetd about x axis

        def funcs(u, v):
            return np.array([
                np.sqrt((u)-(v**2)),
                u

            ])

        start_color = BLUE
        end_color = YELLOW

        paraboloid = Surface(
            lambda u, v: axes.c2p(*funcs(u, v)), u_range=[0, 5], v_range=[-5, 5], fill_color=end_color,
            color=start_color, resolution=8, checkerboard_colors=[start_color, end_color], fill_opacity=0.75, stroke_color=BLUE, stroke_width=0.5,)

        self.play(FadeIn(axes))
        self.wait(2)
        self.play(FadeIn(function))
        self.play(FadeIn(rec))
        self.play(Write(rec_label))
        self.play(FadeIn(area))
        self.wait(2)
        self.begin_ambient_camera_rotation()
        self.set_camera_orientation(phi=75 * DEGREES, theta=-30 * DEGREES)
        self.play(Rotating(group, axis=RIGHT, radians=2*PI,
                           about_point=ORIGIN), run_time=5, rate_func=linear)
        self.wait(2)
        self.play(FadeIn(paraboloid))
        self.wait(2)

the problem is clearly in defining paraboloid Surface what did I get wrong?  error:
TypeError: LinearGradient.new() takes exactly 4 arguments (2 given)
seems like I am missing some args when defining the surface. seems like the LinearGradient method is inside the Surface class

There are 2 problems in your Surface() object:
a) the function to be plotted needs to return 3 values, the x, y and z value to span the surface
b) your function at least at some points delivers complex numbers as a result of the argument of np.sqrt((u)-v**2) becoming less than zero
I cut out everything else and made a minimalistic version of just the Surface() I don't know if this is what you expect to see, but at least the code runs without error.
class SolidsMini(ThreeDScene):
    def construct(self):

        x_min, x_max, x_step = 0, 5, 1
        y_min, y_max, y_step = -5, 5, 1
        z_max, z_min, z_step = -5, 5, 1
        axes = ThreeDAxes(
            x_range=[x_min, x_max + x_step, x_step],
            y_range=[y_min, y_max + y_step, y_step],
            z_range=[z_min, z_max + z_step, z_step],)

        def funcs(u, v):
            return np.array([
                u, v, np.sqrt(abs((u)-(v**2))),
            ])

        start_color = BLUE
        end_color = YELLOW

        paraboloid = Surface(
            lambda u, v: axes.c2p(*funcs(u, v)), 
            u_range=[0, 5], 
            v_range=[-5, 5], 
            #fill_color=end_color,
            #color=start_color, 
            resolution=8, 
            checkerboard_colors=[start_color, end_color], 
            fill_opacity=0.75, 
            stroke_color=BLUE, 
            stroke_width=0.5,
        )

        self.play(FadeIn(axes))

        self.set_camera_orientation(phi=75 * DEGREES, theta=-30 * DEGREES)
        self.wait(2)
        self.play(FadeIn(paraboloid))
        self.wait(2)


Edit 2023-06-14
Ok, with this new information: The easiest way would be to parametrize your surface in cylindrical coordinates then:
    def construct(self):

        x_min, x_max, x_step = -5, 5, 1
        y_min, y_max, y_step = -5, 5, 1
        z_min, z_max, z_step = -5, 5, 1
        axes = ThreeDAxes(
            x_range=[x_min, x_max + x_step, x_step],
            y_range=[y_min, y_max + y_step, y_step],
            z_range=[z_min, z_max + z_step, z_step],
        )

        def funcs(u, v):
            # parametrize u as x and v as phi
            # then the radius increases as the sqrt(u)
            return [u, np.sqrt(u)*np.cos(v), np.sqrt(u)*np.sin(v)]

        start_color = BLUE
        end_color = YELLOW

        paraboloid = Surface(
            lambda u, v: axes.c2p(*funcs(u, v)), 
            u_range=[0.01, 5], 
            v_range=[0, 2*PI], 
            resolution=20, 
            checkerboard_colors=[start_color, end_color], 
            fill_opacity=0.75, 
            stroke_color=BLUE, 
            stroke_width=0.5,
        )        

        self.set_camera_orientation(phi=75 * DEGREES, theta=-30 * DEGREES)
        
        self.add(axes)
        self.add(paraboloid)
        self.wait()


Alternatively you can map u and v onto the x/y plane but y needs to be limited since python will happily draw the root out of a negative number and return a complex value....
class SolidsMini2(ThreeDScene):
    def construct(self):

        x_min, x_max, x_step = -5, 5, 1
        y_min, y_max, y_step = -5, 5, 1
        z_min, z_max, z_step = -5, 5, 1
        axes = ThreeDAxes(
            x_range=[x_min, x_max + x_step, x_step],
            y_range=[y_min, y_max + y_step, y_step],
            z_range=[z_min, z_max + z_step, z_step],
        )

        def upper(u, v):
            # parametrize u as x and v as y
            # y needs to be limited
            # -np.sqrt(u) <= y <= +np.sqrt(u)
            x = u
            y = v/5.01 * np.sqrt(u)
            arg = x - y**2 
            if arg < 0:
                arg = 0             
            z = np.sqrt(arg)
            return [x,y,z]

        def lower(u, v):
            # parametrize u as x and v as y
            # 
            x = u
            y = v if abs(v) < np.sqrt(u) else np.sign(v)*np.sqrt(u)
            arg = x - y**2 
            if arg < 0:
                arg = 0 
            z = -np.sqrt(arg)
            return [x,y,z]

        start_color = BLUE
        end_color = YELLOW

        paraboloid = Surface(
            lambda u, v: axes.c2p(*upper(u, v)), 
            u_range=[0.01, 5], 
            v_range=[-5, 5], 
            resolution=20, 
            checkerboard_colors=[start_color, end_color], 
            fill_opacity=0.75, 
            stroke_color=BLUE, 
            stroke_width=0.5,
        )        

        self.set_camera_orientation(phi=75 * DEGREES, theta=-30 * DEGREES)
        
        self.add(axes)
        self.add(paraboloid)
        self.wait()



I am expecting to see something like this 

Thats clever solution if you have time can you explain how the parametrization works?

Why did you take y as y = v/5.01 * np.sqrt(u)

u and v form a grid on the actual surface of the Surface() and I want to map this surface onto the x/y plane. Since I then let -5 <= v <=+5, the division by 5.01 scales it to a range in the interval (-1,+1). Multiplied with sqrt(u) gives us y-values in the range (-sqrt(u),+sqrt(u)) which gives us the parabola on the x/y plane as outer limit of the surface.
If you scale by exactly 5 instead of 5.01 you might get ugly artefacts at the edge.
