Message Boards Message Boards

GROUPS:

Plot Question using Show[] function with different domain ranges

Posted 1 month ago
223 Views
|
1 Reply
|
2 Total Likes
|

My goal is to display the inverse trigonometric function of ArcCos and Cos through a specific x range of 0 to Pi for Cos and -1 to 1 for the ArcCos since those domain ranges will pass the horizontal line test as being one-to-one and thus inverses within that domain.

I do not have any problem plotting Cos and ArcCos individually as shown below in the following two plots - see attached.

However when I try to combine the two plots using the Show[] function, as displayed in the last plot, the results are far from desirable.

I have tried a bunch of different configurations and various options, but so far nothing has seemed to correct the problem so I decided to reach out to the community for help. Undoubtedly it is something that I am not doing correctly and I would appreciate someone in the community showing me the correct way of handling this sort of situation.

Thanks,

Mitch Sandlin

Attachments:

The Show command adopts the PlotRange from the first plot, which can be annoying. You can impose your own PlotRange that covers your whole range of interest:

Show[Plot[ArcCos[x], {x, -1, 1}], Plot[Cos[x], {x, 0, \[Pi]}], 
 PlotRange -> All, AspectRatio -> Automatic]
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract