# Trying to plot S curve with Mathematica filling in the blanks between data points

I'm completely new to Mathematica and trying to figure some stuff out as a first practical project. I'm trying to plot a calibration curve to fit some data to. As my first step I'm attempting to graph the calibration curve as a line graph. I have a list of "bins" that specific energy levels of particles go into (in keV), but the scale for the bins isn't linear. I'm trying to get a graph of 10 data points. I'm basically trying to get mathematica to draw a line between each of these data points using the bin # as the X axis while filling in the distance between bins. For example drawing a curved line between bin 0 with a value of 2.94, 50 with a value of 10.89, 845 with a value of 138.92 and so on. I have 10 values, but can't figure out what kind of line plot would use the bin numbers as an X axis marker and fill in the blanks between each keV point, or how to enter the command in the first place. Each bin represents a value from a gamma spectrograph, and the keV value represents the energy at a given point.

• maybe just ListPlot with Joined True ? Its not very clear what you are asking – george2079 Nov 12 '16 at 12:39

You can use Interpolation

data = {{0, 2.94}, {50, 10.89}, {845, 138.92}};

energy = Interpolation [data, InterpolationOrder -> 2];


With the complete data set, a higher interpolation order can be used.

{binMin, binMmax} = MinMax[data[[All, 1]]];

Plot[energy[bin], {bin, binMin, binMmax},
Frame -> True,
Axes -> False,
FrameLabel -> (Style[#, 14, Bold] & /@
{"Bin Number", "Energy Level (keV)"})]


• This worked perfectly. Now I just have to fit a bunch of data to the curve this is generating! – Josh Lucy Nov 14 '16 at 20:30