Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legend override_aes #1115

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
Add a test for override_aes
  • Loading branch information
MKoroteev-HORIS committed Jun 16, 2024
commit 940e0b55e9b15ed95588fbc26d5c0a709244c12a
9 changes: 9 additions & 0 deletions python-package/test/plot/test_guides.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Use of this source code is governed by the MIT license that can be found in the LICENSE file.
#
import lets_plot as gg
from lets_plot import geom_point
from lets_plot.plot.guide import guide_legend, guide_colorbar


Expand All @@ -24,3 +25,11 @@ def test_shape_and_color_guides():
assert as_dict['color']['nbin'] == 8
assert as_dict['color']['title'] == "Color title"


def test_override_aes():
spec = (gg.ggplot() + gg.guides(color=guide_legend(override_aes=dict(color=['grey'], size=10))))

as_dict = spec.as_dict()['guides']['color']['override_aes']
assert as_dict['color'][0] == 'grey'
assert as_dict['size'] == 10