Question: Im kinda new to Python, and really really new to matplotlib.

Let's say i have this `x` and `y`:

```
x=[1, 2, 3, 4, 5]
y=[9, 9, 8, 8, 7]

```

In general, my y values are between 1 and 9. And i want to plot those values, even if i don't really have them on my Dataset, so i tried this :

```
plt.yticks(ticks=[1, 2, 3, 4, 5, 6, 7, 8, 9])
plt.plot(x, y)

```

But it's not really working.. it's only plotting y= 9, 8 and 7. How can i plot 1, 2 , 3, 4, 5 and 6 ?

Full code :

```
import numpy as np
import matplotlib.pyplot as plt

x=[1, 2, 3, 4, 5]
y=[9, 9, 8, 8, 7]

plt.yticks(ticks=[1, 2, 3, 4, 5, 6, 7, 8, 9])
plt.plot(x, y)

```

Answer: 
Since there's nothing relating `T` to `X`, there's no way for the compiler to know they're related to one another.

It's not clear what you're trying to do with `T`, `X` is sufficient:

```
public class Main
{
    static class GenericCheck<X>{
        private X x;
        GenericCheck(X t){ // *** Use `X` directly
            x=t;
            System.out.println(t);
        }
        public void display(){
            System.out.println(x);
        }
    }
    public static void main(String[] args) {
        GenericCheck<String> genericCheck = new GenericCheck<>("sathish worked");
        // Need to provide generic here too ----------------^^  That shorthand form is fine

    }
}

```

But if you want `T`, it will need to be related to `X` in some way, for example:

```
public class Main
{
    static class GenericCheck<X>{
        private X x;
        <T extends X> GenericCheck(T t){
        //^^^^^^^^^^
            x=t;
            System.out.println(t);
        }
        public void display(){
            System.out.println(x);
        }
    }
    public static void main(String[] args) {
        GenericCheck<String> genericCheck = new GenericCheck<>("sathish worked");
        // -------------------------------------------------^^

    }
}

```

...but there's no reason to do that unless you have some other constraint on `T`, since you can already provide a subclass of `X` during construction with the class in the first code block above. This works fine, for instance:

```
class Base {
}
class Derived extends Base {
}
public class Example
{
    static class GenericCheck<X>{
        private X x;
        GenericCheck(X t){
            x=t;
            System.out.println(t.getClass().getName());
        }
        public void display(){
            System.out.println(x);
        }
    }
    public static void main(String[] args) {
        GenericCheck<Base> genericCheck = new GenericCheck<>(new Derived());
    }
}

```
JVM can not do x=t if there is not any relationship declared.
You can override the error though with explicit casting like 

```
x=(Object)T;

```