Interactive logistic map The purpose of this project is to generate an interactive logistic map. The user can click on the produced picture to magnify the picture at that point.
Here is the logistic map equation:

Here is my program:
public class LogisticMap {
    public static double returnLogisticEquation(double x, double r) {
        return r * x * (1 - x);
    }

    public static double ignoreFirstIterations(int numberOfIterations, double x, double r) {
        for (int i = 0; i &lt; numberOfIterations; i++) {
            x = returnLogisticEquation(x, r);
        }
        return x;
    }

    public static void drawLogisticMap(int numberOfHorizontalPoints, int numberOfVerticalPoints, double leftOfRInterval, double rightOfRInterval, double x) {
        StdDraw.setYscale(0, 1);
        StdDraw.enableDoubleBuffering();
        double subintervalLength = (rightOfRInterval - leftOfRInterval) / numberOfHorizontalPoints;
        int numberOfIterations = 1000;
        for (double r = leftOfRInterval; r &lt; rightOfRInterval; r += subintervalLength) {
            x = ignoreFirstIterations(numberOfIterations, x, r);
            for (int p = 0; p &lt; numberOfVerticalPoints; p++) {
                x = returnLogisticEquation(x, r);
                StdDraw.point(r, x);
            }
        }
        StdDraw.show();
    }
    
    public static void interactiveLogisticMap(int numberOfHorizontalPoints, int numberOfVerticalPoints, double leftOfRInterval, double rightOfRInterval, double x) {
        StdDraw.setXscale(leftOfRInterval, rightOfRInterval);
        drawLogisticMap(numberOfHorizontalPoints, numberOfVerticalPoints, leftOfRInterval, rightOfRInterval, x);

        double r = 0;
        double y = 0;
        double scale = 0.05;

        while (true) {
            if (StdDraw.isMousePressed()) {
                r = StdDraw.mouseX();
                y = StdDraw.mouseY();

                double newLeftOfRInterval = r - scale;
                double newRightOfRInterval = r + scale;
                double belowRInterval = y - scale;
                double aboveRInterval = y + scale;

                StdDraw.setXscale(newLeftOfRInterval, newRightOfRInterval);
                StdDraw.setYscale(belowRInterval, aboveRInterval);
                StdDraw.clear();
                drawLogisticMap(numberOfHorizontalPoints, numberOfVerticalPoints, newLeftOfRInterval, newRightOfRInterval, x);

                scale /= 10;
            }
        }
    }
    
    public static void main(String[] args) {
        StdDraw.setCanvasSize(850, 850);

        int numberOfHorizontalPoints = 800;
        int numberOfVerticalPoints = 1000;
        double leftOfRInterval = 2.4;
        double rightOfRInterval = 4;
        double x = Math.random();

        interactiveLogisticMap(numberOfHorizontalPoints, numberOfVerticalPoints, leftOfRInterval, rightOfRInterval, x);
    }
}

StdDraw is a simple API written by the authors of the book Computer Science An Interdisciplinary Approach. I checked my program and it works. Here is one instance of it.
Output (actually a succession of outputs):


Is there any way that I can improve my program?
Thanks for your attention.
public static double returnLogisticEquation(double x, double r) {

The name is not quite correct, as it does return the result of equation, not the equation itself, so more like calculateLogisticEquation.

    public static double returnLogisticEquation(double x, double r) {
        return r * x * (1 - x);
    }

I'm torn on this one. Normally, I say that you are only allowed to use single-letter variables when dealing with dimensions (yes, that disallows &quot;i&quot;, &quot;j&quot;, &quot;k&quot; too). However, when implementing mathematical functions there might be a reason to use them. However, using the long names might still be an improvement:
    public static double returnLogisticEquation(double populationRatio, double reproductionate) {
        return reproductionRate * populationRatio * (1 - populationRatio);
    }


for (int i = 0; i &lt; numberOfIterations; i++) {

That's what I meant:
for (int counter = 0; counter &lt; numberOfIterations; counter++) {


public static double ignoreFirstIterations(int numberOfIterations, double x, double r) {

I'm not sure about the name here, maybe forward(int numberOfIterations, ...) would be a better name, as normally, I'd not assume a function that ignores something to return something.

    public static double ignoreFirstIterations(int numberOfIterations, double x, double r) {
        for (int i = 0; i &lt; numberOfIterations; i++) {
            x = returnLogisticEquation(x, r);
        }
        return x;
    }

Assigning to a parameter is bad style. Even though you can treat it as just another declaration, it might lead to confusion down the line. For example if you have an object as parameter and the following line:
thisIsAParameter.setValue(&quot;value&quot;);

If you have the habit of assigning parameters, you now need to check whether there was a different object assigned to the parameter before that function call. Ideally, parameters would be final, but that is quite noisy, though. Threat them as final.

int numberOfIterations = 1000;

It's not the number of iterations, it's the number of ignored iterations.

r += subintervalLength

For the record: += and other shorthand operators are not short for a = a + b, but for a = (TYPE_A)(a+b), which might yield unexpected results. For example, intA = intA + 5.5d will yield an error that a double is truncated to an int. intA += 5.5d will yield no such error.

    public static void drawLogisticMap(int numberOfHorizontalPoints, int numberOfVerticalPoints, double leftOfRInterval, double rightOfRInterval, double x) {
        StdDraw.setYscale(0, 1);
        StdDraw.enableDoubleBuffering();
        double subintervalLength = (rightOfRInterval - leftOfRInterval) / numberOfHorizontalPoints;
        int numberOfIterations = 1000;
        for (double r = leftOfRInterval; r &lt; rightOfRInterval; r += subintervalLength) {
            x = ignoreFirstIterations(numberOfIterations, x, r);
            for (int p = 0; p &lt; numberOfVerticalPoints; p++) {
                x = returnLogisticEquation(x, r);
                StdDraw.point(r, x);
            }
        }
        StdDraw.show();
    }

A few more empty lines to group logic would be nice (like you've done in other functions).
    public static void drawLogisticMap(int numberOfHorizontalPoints, int numberOfVerticalPoints, double leftOfRInterval, double rightOfRInterval, double x) {
        StdDraw.setYscale(0, 1);
        StdDraw.enableDoubleBuffering();
        
        double subintervalLength = (rightOfRInterval - leftOfRInterval) / numberOfHorizontalPoints;
        int numberOfIterations = 1000;
        
        for (double r = leftOfRInterval; r &lt; rightOfRInterval; r += subintervalLength) {
            x = ignoreFirstIterations(numberOfIterations, x, r);
            
            for (int p = 0; p &lt; numberOfVerticalPoints; p++) {
                x = returnLogisticEquation(x, r);
                
                StdDraw.point(r, x);
            }
        }
        
        StdDraw.show();
    }


while (true) {

If you can include a dynamic break condition, do so (like listening for ESC).

        double r = 0;
        double y = 0;

Declare variables where they are used, to limit the scope in which they exist to limit possible errors.
                double r = StdDraw.mouseX();
                double y = StdDraw.mouseY();


double scale = 0.05;

Seems more like this should either be a parameter, or a class-level constant.

I haven't tested your code or verified the mathematical correctness, but looks good so far.