1
$\begingroup$

I have a data point that lands right on the Y axis, which corresponds to the index of refraction of some sample. the x axis is the mole fraction of chloroform of my samples.

How do I get the first data point to look sensible (ie, not directly on the axis). I think it looks funny like this.

Needs["ErrorBarPlots`"];
moleFraction[molesA_, molesB_] = molesA/(molesA + molesB);
molesChloroform = {0.125, 0.100, 0.0625, 0.0375, 0};
molesAcetone = {0, 0.027, 0.068, 0.0952, 0.136};
molefrac = moleFraction[molesChloroform, molesAcetone];
calibrationIndexOfRefraction = {1.440, 1.421, 1.395, 1.380, 1.351};
errorBars = {0.1, 0.1, 0.1, 0.1, 0.1};
newList = Partition[Riffle[molefrac, calibrationIndexOfRefraction], 2];
test = Thread[{newList, ErrorBar[errorBars[[1]], 0]}]
ErrorListPlot[test, PlotRange -> {{0, 1.2}, {1.30, 1.45}}, 
 Frame -> True]

My Plot

$\endgroup$
4
$\begingroup$

Since you are using a Frame you do not need Axes at all. You could use:

ErrorListPlot[test, PlotRange -> {{-0.15, 1.2}, {1.30, 1.45}}, Frame -> True, Axes -> None]

Though longer you could also use PlotRangePadding if you wish not to change PlotRange:

ErrorListPlot[test,
 PlotRange -> {{0, 1.2}, {1.30, 1.45}},
 Frame -> True, Axes -> None, 
 PlotRangePadding -> {{0.15, 0}, {0, 0}}
]

enter image description here

If you actually need axis lines you can use AxesOrigin:

ErrorListPlot[test,
 PlotRange -> {{-0.15, 1.2}, {1.30, 1.45}},
 AxesOrigin -> {-0.15, 1.3}
]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.