Plotting 3D Regions in Mathematica 7

In summary: NIn summary, The conversation discusses plotting a 3D region in Mathematica 7 and the use of ColorFunction. The speaker asks for help on creating a gradient on the cut out surface of the sphere, with colors representing a temperature profile. Another speaker suggests adding the option ColorFunctionScaling -> False to solve the issue. It is explained that this is a feature, as the parameters are normally scaled to be between 0 and 1. The conversation ends with a clarification on how the scaling works.
  • #1
n00dle0
5
0
Hi!

I am plotting the following in Mathematica 7.

Code:
RegionPlot3D[(x^2 + y^2 + z^2 <= 1) && (x < 0 || y > 0 || 
    z < 0), {x, -1, 1}, {y, -1, 1}, {z, -1, 1}, 
 ColorFunction -> 
  Function[{x, y, z}, ColorData["TemperatureMap"][x^2 + y^2 + z^2]], 
 PlotPoints -> 50, Mesh -> False, 
 Lighting -> {{"Directional", 
    RGBColor[1, 1, 1], {{-1, 1, -1}, {0, 0, 0}}}}, 
 AxesLabel -> {X, Y, Z}, {ViewPoint -> {2, -0.5, 0.5}}]

I need the plot to look such that the color on the cut out surface of the sphere should be a gradient in a radial fashion. Assume that there is a point heat source at the center of the sphere and colors represent the temperature profile within the sphere. Any ideas?

Thanks in advance,
- N
 
Physics news on Phys.org
  • #2
Add the option ColorFunctionScaling -> False

I don't know why, but it seems that the scaling is the problem.
 
  • #3
DaleSpam said:
Add the option ColorFunctionScaling -> False

I don't know why, but it seems that the scaling is the problem.

Thanks a lot Dale. I had been struggling with it since a week. Now does anyone have idea as to why. Is this behavior a feature or a bug?

- N
 
  • #4
n00dle0 said:
Thanks a lot Dale. I had been struggling with it since a week. Now does anyone have idea as to why. Is this behavior a feature or a bug?

- N

Well this seems to be the feature, as the help specifies,

Parameters to ColorFunction are normally scaled to be between 0 and 1:
__________________________(by default)_________________________

So, the parameters are scaled, not the results.

- N
 
  • #5
n00dle0 said:
Well this seems to be the feature, as the help specifies,

Parameters to ColorFunction are normally scaled to be between 0 and 1:
__________________________(by default)_________________________

So, the parameters are scaled, not the results.

- N
That explains it. So it takes x which ranges from -1 to 1 and rescales it to range from 0 to 1, similarly with y and z. Then when you calculate the norm you essentially get a scaled distance from the point (-1,-1,-1)
 

What is Mathematica 7 and how does it relate to 3D plotting?

Mathematica 7 is a software program used for mathematical, scientific, and engineering calculations and visualizations. It has a built-in 3D plotting function that allows users to create and manipulate 3D graphs and regions.

What are the basic steps for plotting a 3D region in Mathematica 7?

The basic steps for plotting a 3D region in Mathematica 7 are as follows:

  • Define the region using mathematical equations or inequalities.
  • Use the RegionPlot3D function to generate a graph of the region.
  • Customize the appearance of the graph using various options, such as color, lighting, and viewpoint.
  • Manipulate the graph using tools like rotation, scaling, and slicing to better visualize the region.

Can Mathematica 7 plot complex 3D regions?

Yes, Mathematica 7 has powerful capabilities for plotting complex 3D regions, including regions defined by multiple equations or inequalities, regions with holes, and regions with varying levels of density.

Are there any limitations to plotting 3D regions in Mathematica 7?

While Mathematica 7 is a powerful tool for plotting 3D regions, there are some limitations to be aware of. For example, the RegionPlot3D function can only handle a limited number of equations or inequalities, and may struggle with extremely complex or large regions. Additionally, the quality of the resulting graph may be affected by the chosen resolution and sampling method.

Are there any tips for improving the quality of 3D region plots in Mathematica 7?

Yes, there are several tips for improving the quality of 3D region plots in Mathematica 7, such as increasing the resolution, using a finer sampling method, and adjusting the lighting and color options. It may also be helpful to simplify the equations or inequalities defining the region, if possible.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
263
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
224
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
719
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
898
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
Back
Top