how to scale point size by area

Open
#1,452 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
kotlin

Research direction

Start by reading the scale_size_area() implementation and the geom_point size-mapping path named in the report. Reproduce the example with values 20 and 40, inspect the rendered point dimensions, and compare the resulting areas with the documented behavior. Done means confirming whether area scaling is incorrect and adding or updating coverage for the expected proportional areas.

Written by the indexing model from the issue text.

Description

Hi,

I have a case where I need to generate a scatter plot (via geom_point(aes(..., size="value")), where the areas (instead of the radii) of the points should scale by the given value.

For example, a point with the value of 40 should have area twice as a point with value of 20, not twice the radius. I tried setting it by playing with some parameters in scale_size and usingscale_size_area but could not get what I expected. Honestly, the name scale_size_area felt like I found what I was looking for, but did not work as I expected and scaled by the radius (verified via inspecting in the browser).

Is there a way or a workaround to do so or is there a possible implementation error in the scale_size_area()?

Dominant language
Kotlin
Stars
1.8k
Forks
63
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from JetBrains/lets-plot

All issues in JetBrains/lets-plot

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.