-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add title parameter to guide_legend() and guide_colorbar() * Merge guide parameters * Fix test * Add legend title demo. Update future_changes * Cleaned up merge_dicts() * Remove unnecessary scale name manipulations * Fix link * Refresh demo notebook * Change parameter order * Update demo notebook * guide_legend()/guide_colorbar() require keyword arguments except of 'title' * Simplify error message * Simplify 'title' parameter description
- Loading branch information
1 parent
0f6ac94
commit b7bb4bc
Showing
11 changed files
with
353 additions
and
13 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
## [4.3.4] - 2024-mm-dd | ||
|
||
### Added | ||
- Legend title in guide_legend() and guide_colorbar(). | ||
See [example notebook](https://nbviewer.org/github/JetBrains/lets-plot/blob/master/docs/f-24e/legend_title.ipynb). | ||
|
||
### Changed | ||
|
||
- [**breaking change**] guide_legend()/guide_colorbar() require keyword arguments for 'nrow'/'barwidth' other parameters except 'title'. | ||
|
||
### Fixed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# | ||
# Copyright (c) 2024. JetBrains s.r.o. | ||
# 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.plot.guide import guide_legend, guide_colorbar | ||
|
||
|
||
def test_two_guides(): | ||
spec = (gg.ggplot() + gg.guides(color=guide_legend(nrow=1)) + gg.guides(color=guide_legend(title="Title"))) | ||
|
||
as_dict = spec.as_dict()['guides']['color'] | ||
assert as_dict['nrow'] == 1 | ||
assert as_dict['title'] == "Title" | ||
|
||
|
||
def test_shape_and_color_guides(): | ||
spec = (gg.ggplot() + gg.guides(shape=guide_legend(ncol=2, title="Shape title")) | ||
+ gg.guides(color=guide_colorbar(nbin=8, title="Color title"))) | ||
|
||
as_dict = spec.as_dict()['guides'] | ||
assert as_dict['shape']['ncol'] == 2 | ||
assert as_dict['shape']['title'] == "Shape title" | ||
assert as_dict['color']['nbin'] == 8 | ||
assert as_dict['color']['title'] == "Color title" | ||
|