# How to specify resolution of a plot? [closed]

Suppose I need to plot Sin function:

Plot[Sin[x ], {x, -10 , 10 }]


Now I need to specify the resolution of the plot. I tried by using list Plot

ListPlot[Table[Sin[x ], {x, -10, 10, 0.01}], Joined -> True]


But here the x axis is different. In this case it plots from 0 to 20.

Now I have two questions,

1. How to plot a function giving the specifications
2. Is there any way to use ListPlot and get the axis as (-10,10).

## closed as off-topic by Bob Hanlon, Edmund, m_goldberg, Carl Lange, MarcoBJul 1 at 16:32

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Bob Hanlon, Edmund, m_goldberg, MarcoB
If this question can be reworded to fit the rules in the help center, please edit the question.

• You can make the axes agreeby inputting the {x,y} data pairs: ListPlot[Table[{x, Sin[x]}, {x, -10, 10, 0.01}], Joined -> True] – bill s Jun 26 at 13:02
• Are you wanting to control how many points are used to generate the plot? – chuy Jun 26 at 15:35

The reason ListPlot gives you 1 to 20 on the x-axis is that you've only specified y-values in the table. Try:

ListPlot[
Table[
{x, Sin[x]},
{x, -10, 10, 0.1}
]
]


ListPlot expects data to be pairs of {x, y} coordinates. If they are not, it will assign the numbers 1 through n to the x-coordinate.

For using Plot, the "resolution" of the plot can be changed by adjusting PlotPoints and MaxRecursion. This code shows what happens as you change those values. The black points are the points that Plot is using to draw the curve. Of course, in your final plot you probably won't want to show those black dots. They will only show up if you have some specification for Mesh.

TableForm[
Table[
Plot[
Sin[x],
{x, -10, 10},
Mesh -> All,
MeshStyle -> Directive[AbsolutePointSize[3], Black],
PlotPoints -> i,
MaxRecursion -> j
],
{i, 2, 18, 4},
{j, 1, 5, 1}
],