Group Abstract Group Abstract

Message Boards Message Boards

0
|
4.9K Views
|
8 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Struggling with Plot3D for a two function plot

Posted 10 years ago

Just not getting anywhere with this 2 function plot, plot 2 functions (plane and cylinder):

Plot3D[{x+3, x^2 + y^2 - 9}, {x, -5, 5}, {y, -5, 5}]

I don't get a cylinder?

And how do I show axes?

POSTED BY: Alan Smith
8 Replies

A semisphere done in two ways:

Plot3D[Sqrt[1 - (x^2 + y^2)], {x, -1, 1}, {y, -1, 1}]
ContourPlot3D[x^2 + y^2 + z^2 == 1, {x, -1, 1}, {y, -1, 1}, {z, 0, 1}]
POSTED BY: Gianluca Gorni
Posted 10 years ago
POSTED BY: Alan Smith
Posted 10 years ago

Thanks Marco, I had found AxesLabel in the documentation, couldn't get it to work - maybe because I didn't have LabelStyle - but this now goes into my 'cheatsheet' :-)

POSTED BY: Alan Smith
POSTED BY: Gianluca Gorni

The option for Labels is quite easy to find:

ContourPlot3D[{x + 3 - z == 0, x^2 + y^2 - 9 - z == 0}, {x, -5, 5}, {y, -5, 5}, {z, -1, 1}, 
 AxesLabel -> {"x-axis", "y-axis", "z-axis"}, 
 LabelStyle -> Directive[Bold, Medium, Red]]

Cheers, Marco

POSTED BY: Marco Thiel
Posted 10 years ago

OK, this is good thanks. Interestingly it showed the 1st function as y=x+3, I needed z=x+3, got it working with

ContourPlot3D[{x + 3 - z == 0, x^2 + y^2 - 9 - z == 0}, {x, -5,   5}, {y, -5, 5}, {z, -1, 1}]

Is it a good idea to always use implicit functions?

Also I'd really like to label the axes?

POSTED BY: Alan Smith
POSTED BY: Gianluca Gorni

Hi,

ContourPlot3D might help:

ContourPlot3D[{x + 3, x^2 + y^2 - 9}, {x, -5, 5}, {y, -5, 5}, {z, -1, 1}]

enter image description here. Note that I needed to add a range for the z-coordinate.

Cheers,

Marco

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