Ask Your Question
1

Combine two region plots

asked 2017-01-10 02:26:11 +0100

waltersteinlein gravatar image

Hi,

Can I combine two region plots, let's say

region_plot( abs(x) < 1 - abs(y) / 3, (-4,4), (-4,4), plot_points=300).show(aspect_ratio=1)
region_plot( abs(y) < 1 - abs(x) / 3, (-4,4), (-4,4), plot_points=300).show(aspect_ratio=1)

into one singe plot?

Cheers!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-01-10 03:26:09 +0100

kcrisman gravatar image

What about this?

var('y')
R = region_plot( abs(x) < 1 - abs(y) / 3, (x,-4,4), (y,-4,4), plot_points=300)
S = region_plot( abs(y) < 1 - abs(x) / 3, (x,-4,4), (y,-4,4), plot_points=300)
(R+S).show(aspect_ratio=1)
edit flag offensive delete link more

Comments

D'oh! Couldn't have found that on myself :(

waltersteinlein gravatar imagewaltersteinlein ( 2017-01-10 07:02:28 +0100 )edit

Well, I should say that until one gets used to thinking of plots as separate from the actual drawing of a plot, one might not think of this. Also note that this is definitely not the same as plotting the union of the two regions, since each plot has its own boundary.

kcrisman gravatar imagekcrisman ( 2017-01-10 14:00:54 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2017-01-10 02:26:11 +0100

Seen: 542 times

Last updated: Jan 10 '17