Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
example of graphics (stencil) in sage
P = Graphics()
# horizontal and vertical lines
for n in range(3):
P += line2d([(n,-0.5),(n,2.5)], thickness=1, color='black')
P += line2d([(-0.5,n),(2.5,n)], thickness=1, color='black')
# cross-hairs
P += line2d([(1,0),(1,2)], thickness=3, color='black')
P += line2d([(0,1),(2,1)], thickness=3, color='black')
# surrounding points
for n in [-1,1]:
P += point((1+n,1), size=100, color='black', zorder=10)
P += point((1,1+n), size=100, color='black', zorder=10)
# center point
P += point((1,1), size=100, color='blue', zorder=10)
# labels
P += text('$j-1$', (-0.75,0), fontsize=35, color='black')
P += text('$j$', (-0.75,1), fontsize=35, color='black')
P += text('$j+1$', (-0.75,2), fontsize=35, color='black')
P += text('$i-1$', (0,-0.75), fontsize=35, color='black')
P += text('$i$', (1,-0.75), fontsize=35, color='black')
P += text('$i+1$', (2,-0.75), fontsize=35, color='black'),aspect_ratio=1)

This comment has been minimized.

Copy link
Owner Author

@knappa knappa commented Aug 10, 2018


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment