How to plot smoother curves in R
plot, r
Solution
I'm fairly certain that if you plot your figure for example as pdf, the curves are completely smooth. It's the Rgui's internal display which shows the curve as non-smooth, and using copy paste on that might cause problems. It's better to directly plot into the file, like this:
# Open device:
pdf("D:/test.pdf") #change for appropriate file path
plot(NA,xlim=c(0,1),ylim=c(0,1),xlab="delta",ylab="K", xaxs="i",yaxs="i")
a1 <- curve((x+x^7-x^2-x^4)/(1+x-x^3-x^4), from=0, n=450000, add = TRUE)
dev.off() #close device
Now look at the pdf, and it looks completely fine. If you want for example jpg image, use function `jpeg` etc, see `?jpeg` for more details how to save as tiff, jpeg, png or bmp, and arguments for image size, resolution and such.
(note, the terms device etc used here might not be totally correct, I'm not completely familiar with this terminology, someone more clever can edit if appropriate).
Problem
Using `R` , I have drawn a hatched plot. If you see the curves, they are not smooth. How to make them smooth ? Even excel plots far more smoother curves. Device features: windows 7, screen resolution=1366 x 768 (max) Here is the plot. Following code is used to draw the plot. ``` plot(NA,xlim=c(0,1),ylim=c(0,1),xlab="delta",ylab="K", xaxs="i",yaxs="i") # Empty plot a1 <- curve((x+x^7-x^2-x^4)/(1+x-x^3-x^4), from=0, n=450000, add = TRUE) # First curve ``` Full code is available here