I'm try to plot the function $2^f(x)$ where $f(x)$ is a piecewise function. $f$ is given by a set of coordinates, i.e:

```
\addplot[blue,line width=1pt,rounded corners=1pt] coordinates {
(-6,4)
(-2,0)
(-1,0)
(0,-3)
(1,1)
(2,0)
(3,1)
};

```

Is there a way to get $2^f(x)$ using the given coordinates?

Here the code and the output:

Current
-------

[![enter image description here](https://i.stack.imgur.com/nT2P7.png)](https://i.stack.imgur.com/nT2P7.png)

But I aiming to get the following plot:

Goal
----

[![enter image description here](https://i.stack.imgur.com/Ez2Uc.png)](https://i.stack.imgur.com/Ez2Uc.png)

```
\begin{tikzpicture}[]
\begin{axis}[
grid=both,
width=7cm, height=7cm,
axis x line=middle, 
axis y line=middle, 
samples=100,
ymin=-6.2, ymax=6.2,
xmin=-6.2, xmax=6.2,
domain=-6:6,
xlabel=$x$,
ylabel={$y$},
axis equal image
]
\addplot[blue,line width=1pt,rounded corners=1pt] coordinates {
(-6,4)
(-2,0)
(-1,0)
(0,-3)
(1,1)
(2,0)
(3,1)
} node[right]{$f(x)$};
\addplot[red,line width=1pt,rounded corners=1pt] coordinates {
(-6,{2^4})
(-2,{2^0})
(-1,{2^0})
(0,{2^(-10)})
(1,{2^1})
(2,{2^0})
(3,{2^1})
} node[right]{$2^{f(x)}$};
\end{axis}
\end{tikzpicture}

```