# Plot an output constructed using a table?

**URL:** <https://community.wolfram.com/t/plot-an-output-constructed-using-a-table/15477>\
**Category:** Questions\
**Tags:** graphics-and-visualization\
**Created:** [March 9, 2020, 4:46pm UTC](https://community.wolfram.com/t/plot-an-output-constructed-using-a-table/15477 "2020-03-09T16:46:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdelamotasanchis](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@jdelamotasanchis](https://community.wolfram.com/u/jdelamotasanchis)\
**Post date:** [March 9, 2020, 4:46pm UTC](https://community.wolfram.com/t/plot-an-output-constructed-using-a-table/15477/1 "2020-03-09T16:46:17Z")

</div>

Hello everyone. I have constructed a Mathematica output that constructs a Shannon interpolation for different data stored in a vector using the following command:

```
savedX = Table[XposX = aaa[[All, 1]]; YposX = aaa[[All, 2]]; 
   windXVal = aaa[[All, i]];
   windXMat = Transpose[{XposX, YposX, windXVal}];
   ifuncEPSX = Interpolation[windXMat //. {x_List} :> x];
   intDataVectorEPSX = 
    Flatten[Table[{t, u, ifuncEPSX[t, u]}, {t, xmin, xmax, 
       dDeltaX}, {u, ymin, ymax, dDeltaY}]];
   leEPSX = Length@intDataVectorEPSX;
   vectorXintEPSX = 
    Table[intDataVectorEPSX[[i]], {i, 1, leEPSX - 2, 3}];
   vectorYintEPSX = 
    Table[intDataVectorEPSX[[i]], {i, 2, leEPSX - 1, 3}];
   vectorFintEPSX = Table[intDataVectorEPSX[[i]], {i, 3, leEPSX, 3}];
   interpolatedDataEPSX = 
    Transpose[{vectorXintEPSX, vectorYintEPSX, vectorFintEPSX}];
   shannonInterpolationWindX[t_, u_] = 
    Total[#3*sinc[(t - #1)/dDeltaX]*sinc[(u - #2)/dDeltaY] & @@@ 
      interpolatedDataEPSX], {i, 3, countMax + 2}];

```

Then, if I write `savedX[[2]]` , I get the following

```
12.9185 Sinc[0.20944 (0. + t)] Sinc[0.448799 (-65. + u)] + 
 7.97354 Sinc[0.20944 (15. + t)] Sinc[0.448799 (-65. + u)] 

```

If I write `ContourPlot[savedX[[2]][t, u], {t, xmin, xmax}, {u, ymin, ymax}, GridLines -> {{xmax, xmin}, None}, PlotLegends -> Automatic]`, then the resulting output is an empty map.

If in the previous code I wrote

```
shannonInterpolation[t_, u_]=Total[#3*sinc[(t - #1)/dDeltaX]*sinc[(u - #2)/dDeltaY] & @@@ 
interpolatedDataEPSX]

```

and

```
ContourPlot[
 shannonInterpolationWindX[t, u], {t, xmin, xmax}, {u, ymin, ymax}, 
 GridLines -> {{xmax, xmin}, None}, PlotLegends -> Automatic]

```

Then I get the result I want (see attached file

 ![shannon_1.jpg](https://global.discourse-cdn.com/wolfram/original/3X/2/1/211863ece88857c2d7910ecb133cece7cdeebee0.jpeg)  
)

I am not too familiar with Mathematica, but I see that in this second case, that works, the output looks like `Sinc[0.20944 (0. + t_)]`, the letter t has a ‘\_’ behind and this is probably the source of my issue.

Can someone please tell me how to be able to plot the elements of savedX?  
Any answer is welcome.  
Regards.  
Jaime.

---

<div class="post-metadata">

**Author:** ![rohitnamjoshi](https://avatars.discourse-cdn.com/v4/letter/r/f1d935/32.png) [@rohitnamjoshi](https://community.wolfram.com/u/rohitnamjoshi)\
**Post date:** [March 9, 2020, 11:34pm UTC](https://community.wolfram.com/t/plot-an-output-constructed-using-a-table/15477/2 "2020-03-09T23:34:23Z")

</div>

The posted code and output do not match. e.g. code uses `sinc` and the output has `Sinc`.

The definitions for `shannonInterpolationWindX[t_, u_]` and `shannonInterpolation[t_, u_]` are identical.

With the posted code I don’t see any way a `t_` could appear in the output.

There are many undefined symbols in the posted code, so it is impossible to run it and reproduce your results.

---

<div class="post-metadata">

**Author:** ![jdelamotasanchis](https://avatars.discourse-cdn.com/v4/letter/j/ba8739/32.png) [@jdelamotasanchis](https://community.wolfram.com/u/jdelamotasanchis)\
**Post date:** [March 10, 2020, 11:25am UTC](https://community.wolfram.com/t/plot-an-output-constructed-using-a-table/15477/3 "2020-03-10T11:25:02Z")

</div>

Hello Rohit. First of all, thanks for your answer. [Sinc](https://reference.wolfram.com/language/ref/Sinc.html) is a mathematica function, while I have defined sinc as `sinc = Sinc[Pi #] & ;`  
I am then attaching the code then in case it can be useful.  
Regards.

[shannon\_for\_various\_nodes\_clean.nb](https://community.wolfram.com/uploads/short-url/j5BARILww5Zdoz6LRRxzqBZFgpN.nb) (512 KB)
