I’m a great fan of using R for analysis and visualisation, but for this real-time case, keeping within Python would be much easier to do than trying to interact with R in real time. PsychoPy can draw to a second window on another monitor, so the participant doesn’t need to see what you are graphing. But it would be good to only update the graph once per trial or so rather than update it continually on every screen refresh, as that would likely impair the stimulus drawing performance.