Skip to content

Poor performance of tooltips when gggrid contains plot with coord_polar() #1039

@IKupriyanov-HORIS

Description

Code snippet:

import numpy as np
from scipy.stats import multivariate_normal
from lets_plot import *
LetsPlot.setup_html()
np.random.seed(42)
n = 200
x = np.linspace(-1, 1, n)
y = np.linspace(-1, 1, n)
X, Y = np.meshgrid(x, y)
mean = np.zeros(2)
cov = [[1, -.5], [-.5, 1]]
rv = multivariate_normal(mean, cov)
Z = rv.pdf(np.dstack((X, Y)))

data = {
    'x': X.flatten(), 
    'y': Y.flatten(), 
    'z': Z.flatten()
}

p = ggplot(data) \
    + geom_tile(aes(x='x', y='y', fill='z', color='z'), size=1) \
    + scale_gradient(['color', 'fill'], low='#54278f', high='#f2f0f7') \

p

gggrid([
    p + coord_cartesian(),
    p + coord_cartesian(),
]).show()

gggrid([
    p + coord_cartesian(),
    p + coord_polar(),
])

The tooltips performance of the second gggrid is significantly worse for unknown reasons:

slow_tooltips_with_polar.mov

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions