Group Abstract Group Abstract

Message Boards Message Boards

0
|
3.1K Views
|
2 Replies
|
1 Total Like
View groups...
Share
Share this post:

[Solved] Show two or more plots in one plot

Posted 5 years ago

I want to make with Mathematica the following plot: enter image description here

(I.e., an instructive figure that shows what happens to the function after derivative.)

Let's say that we have

p1 = Plot[x^2, {x, -1, 1}];
p2 = Plot[2 x, {x, -1, 1}];

I am familiar with the Show function, but it just shows one plot over the other.

I came across Overlay and its Alignment option, but I didn't understand how it can help me.

And most Important - I need to export to composite figure to a pdf file in the end, so Grid[{[p1,p2}}] doesn't seem to help either.

Any idea?

POSTED BY: Ehud Behar
2 Replies

Maybe:

 p1 = Plot[x^2, {x, -1, 1}]; p2 = Plot[2 x, {x, -1, 1}];
 Grid[{{p1, "Derivative ->", p2}}]
 Export["test.pdf", Grid[{{p1, "Derivative ->", p2}}]](*In Windows 10 file is: C:\Users\*.*\Documents*)

or:

 Grid[{{p1, Framed@Text[Style["Derivative", Black, Italic, 24]], 
    Text[Style[Graphics[{Arrowheads[1/2], Arrow[{{0, 0}, {1/2, 0}}]}], 
      Black, Italic, 24]], p2}}]
POSTED BY: Mariusz Iwaniuk
Posted 5 years ago

Great, Thanks a lot!

POSTED BY: Ehud Behar
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard