How long have you had the device? I'm guessing this is the the ORIGINAL Pixel? Usually if a phone or other device, for that matter, only works when it's plugged that's using a rechargeable battery it means the battery is not able to accept a charge. My brother and I had laptops that got to that point and so did a coworker. Usually once a battery ages to a certain point this can happen. Prior to this have you noticed any other symptoms i,e, times between charging got shorter, phone was hot while using, swelling of back cover or screen, and so on? I'm guessing it's probably out of warranty. If you feel brave enough to attempt it yourself companies like iFixit sell battery replacement kits but keep in mind if the phone IS still under warranty doing this repair will mostly make said warranty null and void.
franrn, it's always disheartening when your device can't hold a charge or stay on as it should. We'll be happy to help see if we can find a solution to the power issue. It's good to hear you've run different troubleshooting tests. One thing I would suggest doing is running a Device Health Check through the My Verizon app. The details on how to perform that are here: https://www.verizonwireless.com/support/knowledge-base-206364/
If you could share the results for the Battery check, that would be very informative. It's also worth checking for any physical or liquid damage to your Pixel. Power issues like this can be caused by that kind of damage to the phone's hardware. To check for liquid damage, you can use these instructions: https://www.verizonwireless.com/support/knowledge-base-209090/
Please run that Health Check and take a look to see if the Liquid Damage Indicator has been tripped. Also, let us know if the phone has any physical damage.
Follow us on TWITTER @VZWSupport
If my response answered your question, please click the _Correct Answer_ button under my response. This ensures others can benefit from our conversation. Thanks in advance for your help with this!!