0
$\begingroup$

I have the following code

plot1 = ListPointPlot3D[{Table[{10, x, 
     PDF[\[ScriptCapitalD]1, x]}, {x, 18000, 34000, 2}], 
   Table[{20, x, PDF[\[ScriptCapitalD]2, x]}, {x, 18000, 34000, 2}], 
   Table[{30, x, PDF[\[ScriptCapitalD]3, x]}, {x, 18000, 34000, 2}]}, 
  PlotRange -> All, Filling -> Bottom, ImageSize -> 600, 
  AxesLabel -> {"Time", "Is" }, AxesStyle -> Directive[Bold, 18], 
  TicksStyle -> 
   Directive[
    FontSize -> 
     12]];
plot2 = Graphics3D[{Thick, Line[{{10, 0.0001, 0}, {30, 0.0001, 0}}]}];
Show[plot1, plot2]

Which produces this figure

enter image description here

I want to change the X axis so that it goes between 18000 and 34000. As you can see in the code, I have tried to write it as {x, 18000, 34000, 2} of all three pdfs, but, as you can see in the figure, it doesn't seem to work. Can someone please tell me what am I doing wrong?

$\endgroup$
7
  • $\begingroup$ can't run your code. It missing some definitions. $\endgroup$
    – Nasser
    Nov 29 '21 at 9:56
  • $\begingroup$ Specify a plot range in the "Show" command: Show[plot1, plot2, PlotRange -> {{10, 30}, {18000, 34000}, {0, 0.0004}}] $\endgroup$ Nov 29 '21 at 9:56
  • $\begingroup$ @Nasser I am sorry, but to arrive to said figure, it is necessary to load data from external txt files, so even if I published my whole code, you wouldn't be able to run it. $\endgroup$ Nov 29 '21 at 9:59
  • $\begingroup$ @DanielHuber I have tried your solution and I am afraid it doesn't work, the displayed figure is empty $\endgroup$ Nov 29 '21 at 10:00
  • $\begingroup$ OK, I understand. But it will make it easier for someone to help if they can run the code and try things. Otherwise it will just giving somethings to try and fail process which is not efficient. Try Show[plot1,plot2,Options[plot2]] and see if this helps $\endgroup$
    – Nasser
    Nov 29 '21 at 10:02
2
$\begingroup$

Here is an example with PlotRange specified in Show:

\[ScriptCapitalD]1 = NormalDistribution[28000, 2000];
\[ScriptCapitalD]2 = NormalDistribution[25000, 2000];
\[ScriptCapitalD]3 = NormalDistribution[24000, 4000];
plot1 = ListPointPlot3D[{Table[{10, x, 
      PDF[\[ScriptCapitalD]1, x]}, {x, 18000, 34000, 2}], 
    Table[{20, x, PDF[\[ScriptCapitalD]2, x]}, {x, 18000, 34000, 2}], 
    Table[{30, x, PDF[\[ScriptCapitalD]3, x]}, {x, 18000, 34000, 2}]},
    PlotRange -> All, Filling -> Bottom, ImageSize -> 600, 
   AxesLabel -> {"Time", "Is"}, AxesStyle -> Directive[Bold, 18], 
   TicksStyle -> Directive[FontSize -> 12]];
plot2 = Graphics3D[{Thick, Line[{{10, 0.0001, 0}, {30, 0.0001, 0}}]}];
Show[plot1, plot2, 
 PlotRange -> {{10, 30}, {18000, 34000}, {0, 0.0004}}]

enter image description here

$\endgroup$

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