Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #3039

Re: How show axes labels with AxesOrigin->{0,0,0} in 3D?

From Peter Breitfeld <phbrf@t-online.de>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: How show axes labels with AxesOrigin->{0,0,0} in 3D?
Date 2011-06-09 09:45 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <isq4na$62s$1@smc.vnet.net> (permalink)
References <isnllk$n7b$1@smc.vnet.net>

Show all headers | View raw


Murray Eisenberg wrote:

> Aha! Thanks for spotting that the 3D axes labels are really there. But 
> they're hardly in an optimal position.
>
> In 2D, the axes labels are at the ends of the axes. So you'd think, for 
> the sake of Mathematica's much-vaunted consistency, that the same would 
> be the case in 3D.
>
> The example does not really make a reasonable argument against using 
> axes in 3D that emanate from the origin. Rather, it makes a convincing 
> argument that WRI made a dumb design decision when they implemented 
> AxesOrigin for 3D.
>
> On 6/7/2011 6:46 AM, Robert Rosenbaum wrote:

I followed this thread and my opinion is, that at least in education
area axes trough the origin are often used. So I ended with the
following function, which places labels at the end of the axes and plot
any Graphics3D with axes:

NoOpt[x__]:=And@@(Not[OptionQ[#]]&)/@{x}

SyntaxInformation[AchsenStattPlot]=
    {"ArgumentsPattern"->{_,_.,_.,_.,_.,OptionsPattern[]}};
AchsenStattBox[g_Graphics3D,
  achsenOrigin_: {0, 0, 0},
  labFakt :(_Real | _Integer | _List) : 1.2,
  labColor_: Red,
  labSize_: 16,
  opts:OptionsPattern[]]/;NoOpt[achsenOrigin,labFakt,labColor,labSize]:=
 Module[{labels, o = achsenOrigin, xmax, ymax, zmax, lx, ly, lz},
  If[Head[labFakt] === List, {lx, ly, lz} = labFakt,
   {lx, ly, lz} = ConstantArray[labFakt, 3]];
  {xmax, ymax, zmax} = #[[2]] & /@ AbsoluteOptions[g, PlotRange][[1, 2]];
  labels = {
    Text[Style["x", labSize, labColor], {xmax lx, o[[2]], o[[3]]}], 
    Text[Style["y", labSize, labColor], {o[[1]], ymax ly, o[[3]]}], 
    Text[Style["z", labSize, labColor], {o[[1]], o[[2]], zmax lz}]};
  Show[{g, Graphics3D[{labels}]},
    AxesLabel->None, Boxed -> False, AxesOrigin -> o,Evaluate[opts]]
  ]

-- 
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de

Back to comp.soft-sys.math.mathematica | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: How show axes labels with AxesOrigin->{0,0,0} in 3D? Murray Eisenberg <murray@math.umass.edu> - 2011-06-08 11:16 +0000
  Re: How show axes labels with AxesOrigin->{0,0,0} in 3D? Peter Breitfeld <phbrf@t-online.de> - 2011-06-09 09:45 +0000
  Is there ToNumber? Ted Sariyski <tsariysk@craft-tech.com> - 2011-06-11 07:59 +0000
    Re: Is there ToNumber? Albert Retey <awnl@gmx-topmail.de> - 2011-06-14 11:52 +0000
    How to extract a pattern Ted Sariyski <tsariysk@craft-tech.com> - 2011-06-15 11:20 +0000
    Re: Is there ToNumber? "Hans Michel" <hmichel@cox.net> - 2011-06-16 08:02 +0000
  Re: Is there ToNumber? "Dr. Peter Klamser" <klamser@googlemail.com> - 2011-06-11 10:52 +0000
  Re: Is there ToNumber? "Harvey P. Dale" <hpd1@nyu.edu> - 2011-06-12 09:07 +0000
  Re: Is there ToNumber? ADL <alberto.dilullo@tiscali.it> - 2011-06-12 09:07 +0000
  Re: Is there ToNumber? "Hans Michel" <hmichel@cox.net> - 2011-06-12 23:00 +0000
  Re: Is there ToNumber? "Dr. Peter Klamser" <klamser@googlemail.com> - 2011-06-12 23:01 +0000
  Re: Is there ToNumber? DrMajorBob <btreat1@austin.rr.com> - 2011-06-15 11:19 +0000
  Re: Is there ToNumber? Daniel Lichtblau <danl@wolfram.com> - 2011-06-15 11:19 +0000

csiph-web