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

I want to compare 2 plots, and view that 4 lines are exactly the same tangent.

So I would like to view 2 images with the same scale in the y-axis and the same scale in the x-axis

How can I do this. AspectRatio it´s not a solution for me becasue is a ratio for the image not for the scale

Expr1 = -alfa + 1;
Expr2 = -2 alfa + 2;
Expr3 = 5 alfa;
Expr4 = -alfa + 1;

Plot[{Expr1, Expr2, Expr3, Expr4}, {alfa, 0, 1},
 BaseStyle -> AbsoluteThickness[4], 
 PlotLegends -> 
  LineLegend["Expressions", BaseStyle -> AbsoluteThickness[4]], 
 AspectRatio -> 1]

If you plot this one, the same lines moved up/down, you can see that the sacale of y-axis is diferent because the y-range is longer.

Expr1 = -alfa - 2;
Expr2 = -2 alfa + 4;
Expr3 = 5 alfa;
Expr4 = -alfa - 1;

Plot[{Expr1, Expr2, Expr3, Expr4}, {alfa, 0, 1},
 BaseStyle -> AbsoluteThickness[4], 
 PlotLegends -> 
  LineLegend["Expressions", BaseStyle -> AbsoluteThickness[4]], 
 AspectRatio -> 1]

I want to maintain the same scale in the y-axis

share|improve this question

1 Answer 1

up vote 0 down vote accepted
Expr1 = -alfa + 1;
Expr2 = -2 alfa + 2;
Expr3 = 5 alfa;
Expr4 = -alfa + 1;

p1 = Plot[{Expr1, Expr2, Expr3, Expr4}, {alfa, 0, 1},
  BaseStyle -> AbsoluteThickness[4],
  PlotLegends -> 
   LineLegend["Expressions", BaseStyle -> AbsoluteThickness[4]],
  PlotRange -> {Automatic, {-5, 5}},
  AspectRatio -> 1];


Expr1 = -alfa - 2;
Expr2 = -2 alfa + 4;
Expr3 = 5 alfa;
Expr4 = -alfa - 1;

p2 = Plot[{Expr1, Expr2, Expr3, Expr4}, {alfa, 0, 1},
  BaseStyle -> AbsoluteThickness[4],
  PlotLegends -> 
   LineLegend["Expressions", BaseStyle -> AbsoluteThickness[4]],
  PlotRange -> {Automatic, {-5, 5}},
  AspectRatio -> 1];

Grid[{{p1, p2}}]

enter image description here

share|improve this answer
    
perfect That´s what I wanted, but... do you know any way to obtain as independent plots?, without a grid. Because I want to save the legends with the rigth bracket option SAVE AS... –  Mika Ike Jul 16 at 18:39
1  
@mika Ike@ Just remove the semicolons behind the definitions of p1 and p2. Now p1 and p2 pop up and you can save them indepently. –  eldo Jul 16 at 18:49
    
Yes :-) sorry!! –  Mika Ike Jul 16 at 19:02

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.