3
$\begingroup$

I am trying a 3D plot Plot3D[{ x^2 y}, {x, 0, 1}, {y, 0, 1}, AxesLabel -> Automatic, ImageSize -> 300]. However, instead of conventional plotstyle, I need something like following with only three bold axes are and not the box:

enter image description here

$\endgroup$

2 Answers 2

6
$\begingroup$

Updated

Clear[plot, arrowhead, axies]; 
plot = 
 Plot3D[{x^2 y}, {x, 0, 1}, {y, 0, 1}, ImageSize -> 300, 
  Boxed -> False, AxesOrigin -> {0, 0, 0}, Ticks -> {{1}, {1}, {1}}, 
  TicksStyle -> Directive["Label", 14, Thick, Blue], 
  LabelStyle -> Directive[Bold, Blue, FontFamily -> Times, 15], 
  AxesStyle -> Opacity[1], AxesLabel -> {x, y, z}];
arrowhead = 
  Graphics[Polygon[{{-1, 1/4}, {0, 0}, {-1, -1/4}, {-1, 1/4}}]];
axies = Graphics3D[{Arrowheads[{{Automatic, 
       Automatic, {arrowhead, 1}}}], AbsoluteThickness[4], 
    Arrow[{{0, 0, 0}, {1.2, 0, 0}}], Arrow[{{0, 0, 0}, {0, 1.2, 0}}], 
    Arrow[{{0, 0, 0}, {0, 0, 1.2}}], 
    Text[Style[O, Blue, 20, FontFamily -> Times], {0, 0, 0}, {1, 1}]}];
Show[plot, axies, ViewPoint -> {-3, -2, 1}, PlotRange -> All, 
 BoxRatios -> {1, 1, 1}, PlotRangePadding -> 0]

enter image description here

Original

According to the picture,we need to construct a plan arrow instead of a space arrow.

plot = Plot3D[{x^2 y}, {x, 0, 1}, {y, 0, 1}, AxesLabel -> Automatic, 
   ImageSize -> 300];
arrowhead = 
  Graphics[Polygon[{{-1, 1/4}, {0, 0}, {-1, -1/4}, {-1, 1/4}}]];
axies = Graphics3D[{Arrowheads[{{Automatic, 
      Automatic, {arrowhead, 1}}}], AbsoluteThickness[4], 
   Arrow[{{0, 0, 0}, {1.2, 0, 0}}], Arrow[{{0, 0, 0}, {0, 1.2, 0}}], 
   Arrow[{{0, 0, 0}, {0, 0, 1.2}}]}]; 
Show[axies, plot, ViewPoint -> {-3, -2, 1}]

enter image description here

$\endgroup$
2
  • $\begingroup$ thanks, but how to put those ticks: 0 at origin, and 1 at the end of three axes? And I actually need it without boxed, and that I understand can be done by Boxed->False. $\endgroup$
    – User101
    Feb 15, 2022 at 11:11
  • $\begingroup$ @User101 see the updated. $\endgroup$
    – cvgmt
    Feb 15, 2022 at 12:52
0
$\begingroup$

Try to use Boxed -> False, AxesOrigin -> {0, 0, 0}, is that what you want?

$\endgroup$
2
  • $\begingroup$ It doesn't give those nice axes that I am looking for. $\endgroup$
    – User101
    Feb 15, 2022 at 0:21
  • $\begingroup$ Oh! To give this format you will need to use Arrowheads, but unfortunately, in 3D plots, it's more complicated. Maybe here you find a way: mathematica.stackexchange.com/questions/2785/… $\endgroup$
    – Shurato22
    Feb 15, 2022 at 0:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.