lets-plot icon indicating copy to clipboard operation
lets-plot copied to clipboard

Allow tuples to define the linetype in element_line

Open concimuscb opened this issue 1 year ago • 1 comments

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.

concimuscb avatar Sep 26 '24 09:09 concimuscb

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

  • [dash, gap,, ...];
  • [offset, [dash, gap, , ...]];
  • string of hexadecimal digits

OLarionova-HORIS avatar Oct 18 '24 11:10 OLarionova-HORIS

Released in v4.5.0

alshan avatar Oct 23 '24 20:10 alshan