draw function in scikit-geometry fails to display

107 Views Asked by At

i'm getting started with scikit-geometry and am trying to reproduce some of the examples, but the plot function doesn't work as expected.

i'm working in VSCode and managing my environment with Anaconda on Windows 10.

i'm just reading through the samples in the notebook. the snippet runs, but no graphic is displayed.

import skgeom
from skgeom.draw import draw

from matplotlib import pyplot as plt

import math

a = skgeom.Point2(4, 5)

print('a:', a)

draw(a, color='purple')

the docs indicate that the draw function is built from the matplotlib plot function, but it doesn't support the .show() method, so i'm not really sure what i'm doing wrong.

suggestions?

1

There are 1 best solutions below

0
rachelholladay On

I'm not sure that this is what you are supposed to do, but adding a call to plt.show() at the end worked for me.

import skgeom
from skgeom.draw import draw

from matplotlib import pyplot as plt

import math

a = skgeom.Point2(4, 5)

print('a:', a)

draw(a, color='purple')

plt.show()