JetBrains / lets-plot

Multiplatform plotting library based on the Grammar of Graphics
https://lets-plot.org
MIT License
1.57k stars 51 forks source link

Allow tuples to define the linetype in element_line #1198

Closed concimuscb closed 3 weeks ago

concimuscb commented 1 month ago

Hello,

It would be interesting to add the possibility of passing tuples to the linetype argument to define custom linetypes.

I quite like the plotnine implementation: (4, (1, 4, 10, 3))

The first element is always an integer which defines the offset to start drawing the line in relation to the axis of the chart. The second element is a tuple of n elements. The first element is ink, second is space, third is ink, fourth is space, and so on so forth.

In the example a line is drawn with 4 (px?) off set and then 1 px ink, 4 px space, 10 px ink, 3 px space and then the sequence is repeated 1,4,10,3....

Not sure how challenging would it be to implement this.

OLarionova-HORIS commented 4 weeks ago

Commit https://github.com/JetBrains/lets-plot/commit/9ac0ed8762a75472e2587ee270ff203bd79f72a0 :

alshan commented 3 weeks ago

Released in v4.5.0