Group Abstract Group Abstract

Message Boards Message Boards

1
|
4.9K Views
|
6 Replies
|
6 Total Likes
View groups...
Share
Share this post:

Plot range prevents placement of graphic elements

Posted 2 years ago

The plot range prevents graphics elements from being placed outside the plot range. Example: Sine should only be plotted between -Pi and +Pi. But I want to place an arrow from 2Pi to 3Pi.

POSTED BY: Bernd Wichmann
6 Replies
POSTED BY: Arnoud Buzing
Posted 2 years ago

Many thanks for the detailed explanation

POSTED BY: Bernd Wichmann
Posted 2 years ago

Using Show to combine sine curve and arrow:

Show[
  Plot[Sin[x],{x,-Pi,Pi}],
  Graphics@Arrow[{{2 Pi,0.5},{3 Pi,0.5}}],
  PlotRange->All
]
POSTED BY: Hans Milton
Posted 2 years ago

Or using Epilog

epilog = {Red, Thick, Arrow[{{2 Pi, 0}, {3 Pi, 0}}]};
ticks = Range[-Pi, 3 Pi, Pi/2];

Plot[Sin[x], {x, -Pi, Pi},
 PlotRange -> {{-Pi, 3 Pi}, Automatic},
 Ticks -> {ticks},
 Epilog -> epilog]

enter image description here

POSTED BY: Rohit Namjoshi
Posted 2 years ago

Thanks

POSTED BY: Bernd Wichmann
Posted 1 year ago

For me this does not work, in the sense that, if I use (say) "{3 Pi, 10}" instead of "{3 Pi, 0}" in epilog, then the arrow is not fully displayed. I have to replace "Automatic" by the explicit range for this to work.

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