Ask Your Question
0

Reducing the width of an arrow

asked 2023-04-21 16:29:26 +0100

Cyrille gravatar image

In the following code I can increase the width of the arrows but not decrease it. How can I do they are obviously to great

f(x,y) = x^.5*y^.5
# Contours from z1 to z2. 
# This interval is divided into ni subintervals
z1, z2 = 0, 2
ni = 20
dz = (z2-z1)/ni
levels = [z1,z1+dz..z2]
pl = contour_plot(f(x,y), (x,0,2), (y,0,2), contours=levels, 
                      cmap="gist_yarg", colorbar=false,frame=false,axes=false)
pl += arrow((0,0), (2.1,0),color='black')
pl += arrow((0,0), (0,2.1),color='black')
pl += contour_plot(f, (0,2), (0,2), contours=levels, fill=False)
pl += arrow((0,0), (0,2.1),color='black',width=1,arrowsize=.5) #<- here
pl += text(r'$\overline{U}$', (2.1,0.95),color='red')
pl += text(r'$\overline{\overline{U}}$', (2.1,1.1),color='red')
pl += text(r'''$\mathrm{Courbes\,\, d'indifférence}$''', (1,2.3),color='red')
pl += text(r'''$\mathrm{Fonction\,\, de \,\,Cobb-Douglas\,\, : \,\,} U(x,y) = x^{1/2} y^{1/2}$''', (1,2.2),color='red')
show(pl,axes_labels=['$x$', '$y$'],ticks=[None, None],frame=false)

Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2023-05-02 07:03:35 +0100

achrzesz gravatar image

Replace the first two occurrences of arrow by:

pl += arrow((0,0), (2.1,0),color='black',arrowsize=2)
pl += arrow((0,0), (0,2.1),color='black',arrowsize=2)

and delete the third occurence

edit flag offensive delete link more

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-21 16:29:26 +0100

Seen: 150 times

Last updated: May 02 '23