Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Plot spines show in middle of graph

Hi. I am new to SageMath. I like what I see, thanks!

I ran into a tiny but annoying problem: I draw a region_plot and it works very well, but the spines of the plot are drawn down the middle. I tried to make them go away using the standard matplotlib capabilities but they will not disappear. Here is my code:

reset()

a,b,c,x,y = var('a b c x y')

from matplotlib import spines, axes
i = 16
p = region_plot(
    tan(x^2 - y^2)>0,
    (-i*pi,+i*pi), (-i*pi,+i*pi),
    incol='green',outcol='lightblue',
)
p.matplotlib().axes[0].spines[['left', 'bottom']].set_position('zero')
p.matplotlib().axes[0].spines[['top', 'right']].set_visible(False)
p

I am using SageMath on - Ubuntu 22.04 installed in WSL - Notebook is VSCode notebook with vscode-Jupyter extension - Vscode version 1.80

The entire above code is run in a single cell

Thanks