Ask Your Question
0

Changing Tick Marks on Geodesic Plot

asked 2023-04-10 18:51:22 +0200

Jack Zuffante gravatar image
%display latex
M = Manifold(3, 'M', structure='Lorentzian')
X.<t,p,th> = M.chart(r't:(-oo,+oo) p:(-oo,+oo) th')
X
R2 = Manifold(2, 'R^2', latex_name=r'\mathbb{R}^2')
X2.<x,y> = R2.chart()
to_R2 = M.diff_map(R2, {(X, X2): [sqrt(5*p^2+4*t^2)*cos(th), sqrt(5*p^2+4*t^2)*sin(th)]})
to_R2.display()
g = M.metric()
g[0,0], g[1,1] = -1, 1
g[2,2] = 5*p^2+4*t^2
g.display()
p0 = M.point((-7, 10, 0), name='p_0')
v0 = M.tangent_space(p0)((1, -sqrt(120930)/348, (1)/696), name='v_0')
v0.display()
s = var('s')
geod = M.integrated_geodesic(g, (s, 0, 15), v0); geod
sol = geod.solve() 
interp = geod.interpolate() 
graph = geod.plot_integrated(chart=X2, mapping=to_R2, plot_points=500, 
                         thickness=2, label_axes=True)         
graph += p0.plot(chart=X2, mapping=to_R2, size=4)                                
show(graph)

With this code, the x-y plot has different tick mark intervals for each axis. How can I make each axis the same?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-04-11 09:07:10 +0200

eric_g gravatar image

Does

show(graph, ticks=(1,1))

yield what you want?

See the show documentation for more options.

edit flag offensive delete link more

Comments

No. Let me check the documentation.

Jack Zuffante gravatar imageJack Zuffante ( 2023-04-11 19:33:03 +0200 )edit

Actually, maybe what I should have asked is how can I make the scale of the axes 1:1 (as in y=1 is the same length on the screen from the origin as x=1)?

Jack Zuffante gravatar imageJack Zuffante ( 2023-04-16 07:51:46 +0200 )edit

Then, the answer is

show(graph, ticks=(1,1), aspect_ratio=1)
eric_g gravatar imageeric_g ( 2023-04-19 13:28:51 +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: 2023-04-10 18:51:22 +0200

Seen: 859 times

Last updated: Apr 11 '23