Ask Your Question
1

Centering the graphics output

asked 2020-04-22 08:41:04 +0200

Cyrille gravatar image

Is there a way to ask Sagemath to center the graphics in the page ?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-04-22 11:27:14 +0200

ortollj gravatar image

Hi Cyrille

What OS and What Sagemath notebook ?

look here

for me with Ubuntu 18.04 and Sagemath notebook 9.0 it is working with putting:

.output_png {
    display: table-cell;
    text-align: center;
    margin:auto;
}
.prompt 
    display:none;
}

at the end in my css file:./local/lib/python3.7/site-packages/notebook/static/custom/custom.css

like it is recommended in the link above. image description

edit flag offensive delete link more

Comments

I also have a question that I allow myself to add in comment in your question(because it is in relation): how to do so that in the code following the x-axis scale is the same as the y-axis? (so that the angle between the pink vector and the black vector appears at right angles)

u=[1, 3]
v=[3, 4]
p=[9/5, 12/5]
plt=plot(arrow((0,0),v,color='black',width=5,legend_label='V', legend_color='black'))
plt+=plot(arrow((0,0),u,color='red',width=5,legend_label='U', legend_color='red'))

plt+=plot(arrow(p,u,color='pink',width=5,legend_label='W',linestyle='dashed', legend_color='pink'))

show(plt,xmin=-1/2,ymin=-1/2,xmax=5,ymax=5,scale='linear')
ortollj gravatar imageortollj ( 2020-04-22 11:33:32 +0200 )edit
1

I would add aspect_ratio=1 as an option in show.

Juanjo gravatar imageJuanjo ( 2020-04-23 01:22:45 +0200 )edit

Thank you Juanjo, I got a nice right angle now with the option you recomend ;-)

ortollj gravatar imageortollj ( 2020-04-23 07:51:13 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-04-22 08:41:04 +0200

Seen: 463 times

Last updated: Apr 22 '20