# How to set a zero offset for the frame origin?

I want to set a zero offset for the frame origin. In other words, the horizontal axis should start at exactly the lower bound, instead of having a small offset.

For example, in the figure below, even though I set the range of x to be [0, 6], the x axis starts at a small negative value. What do I need to do to make the x axis start at exactly 0?

Needs["PlotLegends"]
Plot[Sin[x], {x, 0, 6}, Frame -> True, FrameLabel -> {x, y},
RotateLabel -> True, PlotLegend -> {"a=1"},
LegendPosition -> {0.3, 0.3}, LegendSize -> 0.5,
LegendShadow -> None, LegendBorder -> None]


-
Add the option PlotRangePadding -> 0? – David Park Aug 15 '13 at 15:56
@DavidPark even if the solution is trivial, it is useful, so why not post an answer? I would also not vote for closure, but that is subjective. – Yves Klett Aug 15 '13 at 16:00
@DavidPark Great. Thanks! – Patrick Li Aug 15 '13 at 16:06
This is one of those "easy to find in documentetion" issues but if you now what to look for :) – Kuba Aug 15 '13 at 16:24

## 1 Answer

This is just to illustrate that the PlotRange and the padding on the Frame are independent of the domain of the Plot function.

Plot[Sin[x], {x, -1, 10},
PlotRange -> {{0, 2 \[Pi]}, {-1, 1}},
PlotRangePadding -> 0,
Frame -> True,
FrameTicks -> {{Automatic, Automatic}, {Range[0, 2 \[Pi], \[Pi]/2],
Automatic}}]
`

-