has2k1 / has2k1/plotnine

Support `key_glyph`

Open
#866 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature
Dominant language
Python
Stars
4.8k
Forks
254
Avg merge
10h 35m
Merged PRs (30d)
9

Description

In ggplot2, geom_* callables support a key_glyph argument:

Each geom has an associated function that draws the key when the geom needs to be displayed in a legend. These functions are called draw_key_*(), where * stands for the name of the respective key glyph. The key glyphs can be customized for individual geoms by providing a geom with the key_glyph argument ( from https://github.com/tidyverse/ggplot2/blob/main/R/legend-draw.R)

In the future, it would be really useful if plotnine supported it as well.

See https://ggplot2.tidyverse.org/reference/draw_key.html

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining plotnine's geom_* callables and how they create legend keys, then compare the requested behavior with ggplot2's legend-draw.R and draw_key.html references. Define how a key_glyph argument selects or supplies a draw_key_* function, and verify that customized legend glyphs work for individual geoms.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.