Ask Your Question
1

Combine two region plots

asked 2017-01-09 19:26:11 -0500

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-09 20:26:09 -0500

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 00:02:28 -0500 )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 07:00:54 -0500 )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-09 19:26:11 -0500

Seen: 32 times

Last updated: Jan 09