# Changing Tick Marks on Geodesic Plot

%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 close merge delete

Sort by ยป oldest newest most voted

Does

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


yield what you want?

See the show documentation for more options.

more

No. Let me check the documentation.

( 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)?

( 2023-04-16 07:51:46 +0200 )edit

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

( 2023-04-19 13:28:51 +0200 )edit