Skip to content

Commit a965a9d

Browse files
committed
Fix asterisk shape
1 parent b4c6550 commit a965a9d

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ skill for llms through the `skill` command (#361)
1515
- Rendering of inline plots in Positron had a bad interaction with how we
1616
handled auto-resizing in the plot pane. We now have a per-output-location path
1717
in the Jupyter kernel (#360)
18-
- Passing the shape aesthetic via `SETTING` now correctly translates named
18+
- Passing the shape aesthetic via `SETTING` now correctly translates named
1919
shapes (#368)
20+
- Asterisk shape now has lines 60 degrees apart, giving an even shape
2021

2122
### Changed
2223

src/plot/scale/shape.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,16 @@ fn vline_coords() -> Vec<Vec<(f64, f64)>> {
162162
vec![vec![(0.0, -0.8), (0.0, 0.8)]]
163163
}
164164

165-
/// Asterisk (*) - three lines through center.
165+
/// Asterisk (*) - three lines through center evenly spaced at 60° (six wedges).
166166
fn asterisk_coords() -> Vec<Vec<(f64, f64)>> {
167-
vec![
168-
vec![(-0.8, 0.0), (0.8, 0.0)], // horizontal
169-
vec![(-0.6, -0.7), (0.6, 0.7)], // diagonal /
170-
vec![(-0.6, 0.7), (0.6, -0.7)], // diagonal \
171-
]
167+
let r: f64 = 0.8;
168+
(0..3)
169+
.map(|i| {
170+
let angle = (i as f64) * std::f64::consts::PI / 3.0;
171+
let (sin, cos) = angle.sin_cos();
172+
vec![(-r * cos, -r * sin), (r * cos, r * sin)]
173+
})
174+
.collect()
172175
}
173176

174177
/// Bowtie - two triangles meeting at center.

0 commit comments

Comments
 (0)