Plotting with interpolation using Matplotlib
As I pointed out in the comments, I do not think smoothing is needed when plotting functions that are already smooth, such as polynominals. In those cases, the graphs would look rough only if the points plotted are not dense enough (on the x axis).

Since you have already imported and used numpy, it would be better to use numpy.polyval for vectorized evaluation of polynominals.

Drawing spines at zero would not work well if the input range does not include zero. In that case, the &quot;center&quot; position might be used instead of &quot;zero&quot;. (I will not implement this logic in my code below)

The top and right spines should not be shown.

Consider using plt.style.use for setting common style information. See here for alternative options for style setting.

Avoid constants like &quot;#47c984&quot;. Name them with appropriate constant names for better readability.

It is a good practice to comply to the PEP 8 style when writing Python code. Use an IDE (such as PyCharm) or an online checker (such as this) for automatic PEP 8 violation checking.

When running code outside a method / class, it is a good practice to put the code inside a main guard. See here for more explanation.


Here is an improved version:
import numpy as np
import matplotlib.pyplot as plt

if __name__ == &quot;__main__&quot;:
    # Define constants (color names come from https://colornamer.robertcooper.me/)
    INPUT_MESSAGE = &quot;Lower and upper bounds of x, separated by a space: &quot;
    NUM_POINTS = 300
    PARIS_GREEN = &quot;#47c984&quot;
    BLAZE_ORANGE = &quot;#fc6703&quot;

    # Read input
    lb, ub = map(float, input(INPUT_MESSAGE).split())

    # Compute coordinates of points to be plotted
    x = np.linspace(lb, ub, NUM_POINTS)
    f_x = np.polyval([1, -6, 1, 5], x)
    g_x = np.square(x - 2) - 6

    # Plotting
    plt.style.use({&quot;lines.linestyle&quot;: &quot;solid&quot;, &quot;lines.linewidth&quot;: 1})
    plt.plot(x, f_x, color=PARIS_GREEN)
    plt.plot(x, g_x, color=BLAZE_ORANGE)

    # Adjust spines
    spines = plt.gca().spines
    spines[&quot;left&quot;].set_position(&quot;zero&quot;)
    spines[&quot;bottom&quot;].set_position(&quot;zero&quot;)
    spines[&quot;right&quot;].set_visible(False)
    spines[&quot;top&quot;].set_visible(False)

    # Display plot
    plt.show()