Suppose that I use the vectors $(2,1)$ and $(-1,1)$ as a basis for $R^2$.
gr = Graphics[{
InfiniteLine[{{0, 0}, {2, 1}}],
InfiniteLine[{{0, 0}, {-1, 1}}],
Blue, Thick,
Arrow[{{0, 0}, {2, 1}}],
Arrow[{{0, 0}, {-1, 1}}],
Text["\!\(\*SubscriptBox[\(v\), \(1\)]\)", {2.2, 0.7}],
Text["\!\(\*SubscriptBox[\(v\), \(2\)]\)", {-1.3, 0.7}]
}, PlotRange -> 6,
Frame -> True,
FrameTicks -> None,
GridLines -> {Range[-6, 6], Range[-6, 6]}]
which produces this plot:
What would be the simplest way to add grid lines for the system based on $v_1$ and $v_2$? That is, lines parallel to $v_1$ spaced by increments equal to the length of $v_2$, and lines parallel to $v_2$ spaced by increments equal to the length of $v_1$, using a color different from the existing colors?
Update: Very nice answer by J.M. Mesh -> 20
didn't work, but Mesh -> 19
did.
pp = ParametricPlot[{x, y}.{{2, 1}, {-1, 1}}, {x, -10, 10}, {y, -10,
10}, BoundaryStyle -> None, Mesh -> 19,
MeshStyle -> Directive[Red, Dashed], PlotStyle -> None];
Show[gr, pp]
which produced this image.
Second Update: Just tried J.M.'s AffineTransform
suggestion:
v1 = {2, 1}; v2 = {-1, 1};
B = Transpose[{v1, v2}];
{xmin, xmax} = {-10, 10};
{ymin, ymax} = {-10, 10};
Graphics[{
GeometricTransformation[{
{Directive[Opacity[0.3, Red], Dashed],
Table[InfiniteLine[{0, k}, {1, 0}], {k, ymin, ymax}]},
{Directive[Opacity[0.3, Red], Dashed],
Table[InfiniteLine[{k, 0}, {0, 1}], {k, xmin, xmax}]}},
AffineTransform[B]]
},
PlotRange -> {{xmin, xmax}, {ymin, ymax}},
GridLines -> {Range[xmin, xmax], Range[ymin, ymax]},
Axes -> True]
which produced this image:
ParametricPlot[{x, y}.{{2, 1}, {-1, 1}}, {x, -10, 10}, {y, -10, 10}, BoundaryStyle -> None, Mesh -> 20, MeshStyle -> Black, PlotStyle -> None]
? $\endgroup$ – J. M. will be back soon♦ May 25 '16 at 19:20