Curved vector graphics using paths.

When drawing curved shapes in R, they usually consist of a set of short straight line segments (with the ends of circular lines). The result looks good for the human eye, but this is a bit roundabout way to do this, since you need to interpolate the curve to get the coordinates of the segments. It also creates unnecessary large files, although this is not a big problem if the graph does not contain an extreme amount of curves.

Is there a way to create curved vector shapes appropriately using paths consisting of GCP and GCP, as shown in the figure below?

enter image description here

+7
source share
1 answer

The short answer is "no."

Long answer: R does not know if your device supports the description of curves from formulas - for example, PDF and PostScript can (I think) have arcs and curves, but R does not know if its drawing has one of these or to a raster device.

Therefore, if you want to draw an arc on the R chart, this cannot do:

0 0 moveto 25 25 pi arcto 

(or whatever PostScript) is for describing an arc that will scale seamlessly. It should map the arc into segments.

If you run the example in help(bezierGrob) on the PDF device and zoom in, you will see segments (increased to 500%).

+2
source

All Articles