Plots not showing up for Sage+Python

asked 2025-01-25 13:19:34 +0100

Vaishnav gravatar image

I'm a newbie to SageMath and I tried running Sage through python on VSCode. I couldn't get the plots to show. The output shows Graphics object consisting of 1 graphics primitive. I am able to save the graphs but the convenience of having the result printed as output is lost. I can make it work with Jupyter environment but I prefer the interface of VS Code. How do I get the plots to show?
I have posted this before but after moderation it was removed. Please, this is genuine concern of mine so kindly don't remove it.

edit retag flag offensive close merge delete

Comments

If I recall correctly, there is usually some kind of "hook" for graphics objects (and certain other output) which the old Sage notebook, an IPython shell, and/or Jupyter or other interfaces (emacs?) would look for in such cases. Presumably there isn't such a hook in VS Code. Unfortunately I'm not an expert on that, but it might lead you in a direction you could implement. I think this might lead you in a good direction (others will correct me): backend base documentation

kcrisman gravatar imagekcrisman ( 2025-02-02 23:06:12 +0100 )edit