You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a question regarding the arrow() function.
Currently, the function generates a polygon representing the arrow. There are two parameters to control the size of the arrow - width and length.
I think it would be better to print an arrow using the text() function as a character at specified coordinates. This would allow users to use different arrow shapes.
default could also be a character that we know is safe on all platforms.
I think that intToUtf8(0x279B) ("➛" Drafting Point Rightwards Arrow) might be that character.
My implementation is half-finished, but I stumbled upon the following problems:
testthat-based unit tests don't play well with UTF-8 characters. The following error occurs: conversion failure on '⤑' in 'mbcsToSbcs': dot substituted for <a4>. I would therefore suggest to use character code instead of the character itself, e.g. symbol=0x279b unstead of symbol="➛"
When a plot is rendered and later resized, polygon-based arrows keep their shape exactly as rendered while character-based arrows will be automatically resized to keep their aspect-ratio. Both approaches have their advantages.
Hi Tarik @tgouhier,
I have a question regarding the
arrow()
function.Currently, the function generates a polygon representing the arrow. There are two parameters to control the size of the arrow - width and length.
I think it would be better to print an arrow using the
text()
function as a character at specified coordinates. This would allow users to use different arrow shapes.Take a look at my implementation here -
arrow2()
function:https://github.com/tgouhier/biwavelet/blob/master/R/phase.plot.R
Notice that my function uses just a single
size
parameter.Here are some examples how it might look like when using
arrow2
instead ofarrow
:The text was updated successfully, but these errors were encountered: