Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm trying to get a very simple plot by plotting:

  • y=3
  • y=2x
  • x=3

I have no problem to plot y=3 and y=2x

However, how do I plot x=3?

plot

I use this code:

usepackage("amsmath,amssymb"); usepackage("inputenc","utf8"); // code
figure import graph; unitsize(1cm,1cm); xlimits(0,10); ylimits(0,10);
real F(real x) {return 3;}
draw(graph(F,0,10,n=400),linewidth(1pt)+black+solid); real G(real x)
{return 2x;} draw(graph(G,0,10,n=400),linewidth(1pt)+black+solid);
xlimits(0,10,Crop); ylimits(0,10,Crop);

xaxis(axis=YEquals(0),xmin=0,xmax=10,Ticks(scale(.7)*Label(),beginlabel=true,endlabel=true,begin=true,end=true,Step=1,Size=1mm),p=linewidth(1pt)+black,Arrow(2mm),true);
yaxis(axis=XEquals(0),ymin=0,ymax=10,Ticks(scale(.7)*Label(),beginlabel=true,endlabel=true,begin=true,end=true,Step=1,Size=1mm),p=linewidth(1pt)+black,Arrow(2mm),true);
// code supplémentaire

shipout(bbox(0.1cm,0.1cm,white));
share|improve this question

migrated from stackoverflow.com Jan 31 '13 at 23:11

This question came from our site for professional and enthusiast programmers.

add comment

1 Answer

up vote 1 down vote accepted

Ok I find the solution:

draw((15,0)--(15,55),linewidth(1pt)+black+solid);

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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