I am having a lenovo X1 running window 10. As mentioned in the title, every time when I plug in my power cord or remove it, my laptop monitor turns off and on. I tried having the power and brightness settings same for when its connected to power and on battery but it still didn't help.
Some laptops lower the monitor's refresh rate when going on battery, to increase it again when main power is restored. This may cause a short flicker.
If this flicker is bothersome, you may lower the refresh rate when on power to be the same as when on battery, to avoid the change.
I have seen laptops that reduced the refresh rate from 60 Herz to 50 Herz on battery. If yours is one of them, connect the power cord and then lower the refresh rate to 50 Herz. This is done in:
Right-click the desktop > Display Settings > Advanced display Settings > Display adapter properties > Monitor tab > Screen refresh rate.
Set Screen refresh rate to 50 Hertz (if available) or lower.