Message Boards Message Boards

0
|
6046 Views
|
5 Replies
|
5 Total Likes
View groups...
Share
Share this post:

[?] Get plot with just axes crossing at the origin?

Posted 6 years ago

Hi, when I plot (3D) a 2 variable scalar function in wolfram Mathemática I always get the function in a box formed by the axis. How could I get rid of that box and just see the surface I´m plotting and the three ortogonal axis crossing at the origin??

POSTED BY: Victor Gutierrez
5 Replies

Beware that if you go the AxesOrigin -> {0, 0, 0} way, the axes will be rendered on top of everything else, which in 3D can be very confusing. I think that the design choices of Wolfram regarding the axes in 3D have good reasons behind. The three axes as arrows make sense only in some cases, and you are advised to draw them manually as appropriate in each situation.

POSTED BY: Gianluca Gorni
Posted 6 years ago

Axes can easily be distinguished by color:

Graphics3D[
    {Cuboid[{2, 2, 2}], Sphere[{2, 2, 2}]},
    Boxed -> False, Axes -> True, AxesOrigin -> {0, 0, 0}, Ticks -> None,
    AxesStyle -> {Red, Darker@Green, Blue}, PlotRange -> 4
 ]

enter image description here

But I can not find a way to add arrowheads to the axes by setting an option to Graphics3D

POSTED BY: Hans Milton

Thanks a lot guys it´s been of great help.

POSTED BY: Victor Gutierrez
Posted 6 years ago

An alternative to Gianlucas suggestion:

Graphics3D[
    {Cuboid[{2, 2, 2}], Sphere[{2, 2, 2}]},
    Boxed -> False, Axes -> True, AxesOrigin -> {0, 0, 0}, Ticks -> None,
    PlotRange -> 4
 ]

enter image description here

POSTED BY: Hans Milton

In dimension 2 it's easy:

Graphics[Circle[], Axes -> True, AxesStyle -> Arrowheads[.1]]

In dimension 3 the box can be deleted with Boxed->False and perhaps Axes->False too. To get the arrows one roundabout way is this:

pl = Graphics3D[{Opacity[.1], Sphere[]}];
{{xmin, xmax}, {ymin, ymax}, {zmin, zmax}} = 
  PlotRange /. AbsoluteOptions[pl, PlotRange];
Show[pl, Graphics3D[{Arrow[{{xmin, 0, 0}, {xmax, 0, 0}}], 
   Arrow[{{0, ymin, 0}, {0, ymax, 0}}], 
   Arrow[{{0, 0, zmin}, {0, 0, zmax}}]}], Boxed -> False]

It can be automated, if necessary. Anyone knows a more elegant solution?

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

Group Abstract Group Abstract