I am trying to plot unit spheres for different distance metrics (2D) in R.
I would like to visualize L_0.1, L_0.5, L_1, L_2, L_4, L_10, L_infinity.
I hope to do something like the following in R but with more metrics.
The following R code is my attempt.
################ Different metrics ##################
fun <- function(x,p=.5){
(abs(x)^.5)}
fun1 <- function(x,p=.5){
(2-abs(x)^.5)}
fun2 <- function(x,p=.1){
(abs(x)^.1)}
fun3 <- function(x,p=.1){
(2-abs(x)^.1)}
fun4 <- function(x,p=1){
(abs(x)^1)}
fun5 <- function(x,p=1){
(2-abs(x)^1)}
fun6 <- function(x,p=2){
(abs(x)^2)}
fun7 <- function(x,p=2){
(2-abs(x)^2)}
fun8 <- function(x,p=4){
(abs(x)^4)}
fun9 <- function(x,p=4){
(2-abs(x)^4)}
fun10 <- function(x,p=10){
(abs(x)^10)}
fun11 <- function(x,p=10){
(2-abs(x)^10)}
plot(fun1,1,-1,ylim=c(2,-0),xlim = c(1,-1))
plot(fun,-1,1,add=T)
plot(fun2,-1,1,add=T)
plot(fun3,-1,1,add=T)
plot(fun4,-1,1,add=T)
plot(fun5,-1,1,add=T)
plot(fun6,-1,1,add=T)
plot(fun7,-1,1,add=T)
plot(fun8,-1,1,add=T)
plot(fun9,-1,1,add=T)
plot(fun10,-1,1,add=T)
plot(fun11,-1,1,add=T)
##########################################################
I am not sure about the function I create. I mean (2-abs(x)). If you notice the original plot I attached in the question centered at zero (y-axis).
Is my code right to reproduce the same plot in the question? and how to give each metrics different colors?

