# Question on combining diagrams

I tried to put a zigzag line within a plot that here is a Streamplot.

However, I failed to combine the figures using Show command.

Would you be so kind as to let me know what is the problem?

I want to put the zigzag line from (x=0,y=0) to (x=0,y=10) within the figure.

s1 := StreamPlot[{1/(x + 1), 1/(y + 1)}, {x, 0, 1}, {y, 0, 1}]
s2 := Rotate[Graphics[Line[Table[{n, (-1)^n}, {n, 120}]]], 90 Degree]
Show[{s1, s2}]

• Only two Graphics can be combined. s2 has head Rotate, not Graphics. Apply Rotate only to the contents of Graphics, not Graphics itself. Commented Apr 24, 2020 at 16:55
• Since you signed your post anyway, please consider setting a username. "user14750" is very hard to distinguish from any other "userXXXXX". Commented Apr 24, 2020 at 16:56
• related: search results - Rotate + Show
– kglr
Commented Apr 25, 2020 at 6:02

Try giving the Epilog option to your stream plot.

StreamPlot[{1/(x + 1), 1/(y + 1)}, {x, 0, 1}, {y, 0, 1},
Epilog -> Rotate[Line[Table[{n, (-1)^n}, {n, 120}]/120], 90 °, {0, 0}]]


### Notes

1. you must use the 3rd argument of Rotate to specify you want the zigzag line rotated about the origin and not the default center of the line.
2. You must also scale your zigzags by dividing by 120.

Of course, it can also be done by combining the stream plot with a correctly specified graphic using Show.

s1 = StreamPlot[{1/(x + 1), 1/(y + 1)}, {x, 0, 1}, {y, 0, 1}];
s2 =
Graphics @ Rotate[Line[Table[{n, (-1)^n}, {n, 120}]/120], 90 °, {0, 0}];
Show[{s1, s2}]


This produces the same image as the previous code.