Plotting 3D Regions in Mathematica 7

  • Context: Mathematica 
  • Thread starter Thread starter n00dle0
  • Start date Start date
  • Tags Tags
    Mathematica Plotting
Click For Summary

Discussion Overview

The discussion revolves around plotting 3D regions in Mathematica 7, specifically focusing on achieving a radial color gradient on the surface of a sphere representing a temperature profile. Participants explore the use of the RegionPlot3D function and address issues related to color scaling in the plot.

Discussion Character

  • Technical explanation
  • Exploratory
  • Debate/contested

Main Points Raised

  • One participant seeks to create a radial color gradient on the cut-out surface of a sphere, representing a temperature profile from a point heat source at the center.
  • Another participant suggests adding the option ColorFunctionScaling -> False to address the color scaling issue.
  • A participant expresses confusion about whether the observed behavior of color scaling is a feature or a bug, indicating a lack of clarity on the functionality.
  • Further clarification is provided that parameters to ColorFunction are scaled between 0 and 1 by default, which affects how the color gradient is applied based on the input values.
  • There is a discussion about how the scaling of parameters impacts the calculation of the norm and the resulting color representation.

Areas of Agreement / Disagreement

Participants generally agree on the need to adjust the ColorFunctionScaling option, but there is ongoing uncertainty regarding the implications of this behavior and whether it is intended functionality or an error.

Contextual Notes

The discussion highlights limitations in understanding the default behavior of color scaling in Mathematica, particularly how input values are transformed before being used in the ColorFunction.

n00dle0
Messages
5
Reaction score
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
Add the option ColorFunctionScaling -> False

I don't know why, but it seems that the scaling is the problem.
 
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
 
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
 
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)
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 4 ·
Replies
4
Views
3K