4

According to the documentation AbsoluteOptions[expr,name] "gives the absolute setting for the option name".

"AbsoluteOptions gives the actual settings for options used internally by Mathematica when the setting given is Automatic or All."

Here is an example they show:

<< AbsoluteOptions[Plot[Sin[x], {x, 0, 2 Pi}, 
     PlotRange -> Automatic], PlotRange]
>> {PlotRange -> {{0., 6.28319}, {-1., 1.}}}

Here I use << to denote Input and >> to denote output.

This seems to work fine. However, when I try to obtain the AspectRatio of a plot it simply gives me Automatic. Try this,

AbsoluteOptions[
 ListPlot3D[{{1, 1, 1, 1}, {1, 2, 1, 2}, {1, 1, 3, 1}, {1, 2, 1, 4}}, 
  AspectRatio -> Automatic],
  AspectRatio
 ]

Similar format as the example they show but the output I get is simply

{AspectRatio->Automatic}

Does this mean that the argument expr can only be a Graphics object and not Graphics3D? This doesn't make sense because it works fine if I try to obtain the PlotRange of a Graphics3D object. Is this a bug or my mathematica is broken? Another thing could be that the documentation is not being very specific. Which one is it? Here is a link to the documentation:

http://reference.wolfram.com/mathematica/ref/AbsoluteOptions.html

I'm using Mathematica 7.0.1.0.

jmlopez
  • 4,853
  • 4
  • 40
  • 74
  • @jmlopez it gives Automatic for Plot3D too here (mma 8)... – acl Jun 09 '11 at 17:46
  • Must be a bug or documentation problem then. – jmlopez Jun 09 '11 at 17:49
  • Related: http://stackoverflow.com/questions/4288713/how-to-determine-plotrange-to-include-all-of-graphics – Dr. belisarius Jun 09 '11 at 17:59
  • Ok, I'm starting to dislike Mathematica now. All I want is to get consistent good looking graphics. Now it turns out I can't really depend on their functions. I might as well write my own routines and make a python script to draw svg pictures. – jmlopez Jun 09 '11 at 18:24
  • @jmlopez perhaps asking another, more specific, question (such as describing in detail the graphics you are trying to create) will attract some useful responses – acl Jun 09 '11 at 18:42
  • @acl, very well. I will post a question later this evening. Maybe someone here already battled with what I'm dealing with. – jmlopez Jun 09 '11 at 18:46
  • @acl here is the question. I decided to forget about this method and simply specify my own aspect ratio. http://stackoverflow.com/questions/6301676/mathematica-rasters-in-3d-graphics – jmlopez Jun 10 '11 at 03:29

2 Answers2

4

You can apply ImageDimensions directly to Graphics3D to get its ImageSize.

It seems that AbsoluteOptions just was not modified since Mathematica 4 (see bottom of the corresponding documentation page). This function is very buggy (often gives wrong value for PlotRange for 2D graphics generated by Show, for example) and sometimes does not work at all as you pointed in your question. Compare it with FullOptions and FullGraphics those are seemed to be not modified since version 2... Sometimes FullOptions gives right value when AbsoluteOptions gives wrong or does not work at all.

Alexey Popkov
  • 9,355
  • 4
  • 42
  • 93
1

Maybe, BoxRatios is the one you are looking for. HTH.

MM Beginner
  • 11
  • 1
  • 1
  • No, these are not the droids I'm looking for. I want to know the AspectRatio of the image so that I can give that AspectRatio to another one. I also can't seem to find the ImageSize. – jmlopez Jun 09 '11 at 18:53
  • You could use `Rasterize` to get the bounding box, in pixel dimensions. – Brett Champion Jun 09 '11 at 19:17
  • 2
    @jmlopez You can apply `ImageDimensions` directly to `Graphics3D` to get its `ImageSize`. – Alexey Popkov Jun 10 '11 at 01:45
  • @Alexey Popkov, Could you write your comment on an answer to the question so that I can give you proper credit? It might also be a good idea to point out what you have found broken as far as options for graphics go. – jmlopez Jun 16 '11 at 00:11
  • @jmlopez It seems that `AbsoluteOptions` just was not modified since *Mathematica* 4. This function is very buggy (often gives wrong value for `PlotRange` for 2D graphics generated by `Show`, for example) and sometimes does not work at all as you pointed in your question. Compare it with `FullOptions` and `FullGraphics` those are seemed to be not modified from version 2... Sometimes `FullOptions` gives right value when `AbsoluteOptions` gives wrong or does not work at all. – Alexey Popkov Jun 16 '11 at 01:55
  • @Alexey, I would like to give proper credit to you since you have answered my question. I'm getting tired of seeing: "Have you considered accepting an answer or starting a bounty for this question?" – jmlopez Jun 16 '11 at 02:45
  • @jmlopez I have created answer and copied my comments into it. – Alexey Popkov Jun 16 '11 at 03:20