Hi! Some folks here might be happen to be familiar with matplotlib, but I would definitely also suggest checking around whatever community forums exist (possibly https://discourse.matplotlib.org) for that particular software.
xclip is built specifically for X11 desktop sessions, so I’d think it would either be extremely limited, or not function at all, in a Wayland desktop session.
Just to check, are you running into any issues specific to KDE software?
Given that the setup involved xclip the other components might be assuming availability of an X11 connection as well.
Your kinfo output suggests that it could either not find either an X11 or Wayland connection (or failed to load the respective plugins) so it fell back to offscreen.
For a native Wayland based workflow you’ll need to check that each component is compatible and setup correctly (might need config, command line arguments, or environment variables)
I found out that the issue was with the terminal, before installing KDE I tried MATE, then I switched to KDE but was still using MATE terminal. Both the plots with matplotlib and the xclip command work fine when I run them from Konsole. Probably because of different env variable settings?