JetBrains / lets-plot

Multiplatform plotting library based on the Grammar of Graphics
https://lets-plot.org
MIT License
1.57k stars 51 forks source link

sampling_vertex_dp may break rings #1176

Closed IKupriyanov-HORIS closed 2 months ago

IKupriyanov-HORIS commented 2 months ago
from lets_plot import *
LetsPlot.setup_html()

def f(x, y, n):
    z = np.sin(x * 3 * np.pi / n)
    z += np.sin(y * 3 * np.pi / n)
    z += x * 3 / n
    z += y * 5 / n
    return z

n = 50
x = np.arange(n)
y = np.arange(n)
X, Y = np.meshgrid(x, y)
Z = f(X, Y, n)
data = dict(
    x=X.reshape(-1),
    y=Y.reshape(-1),
    z=Z.reshape(-1))

p = ggplot(data, aes('x','y', z='z')) \
    + theme_void() + ggsize(200, 200)
p + geom_contour(sampling=sampling_vertex_dp(100))

image

IKupriyanov-HORIS commented 2 months ago

Fixed via 80fcbf2b71b68311d89d5034c36849babb0c6086