Plotting in pyplot: z coordinate always becomes zero when plotted using the scatter when xlims,ylims and zlims are given

The package used is pyplot:
using Plots; pyplot()

This plot
scatter3d([0],[1],[100], xlims=(-100,100),ylims=(-100,100), zlims=(-100,100),c=:red,markersize=5)
and also this plot
scatter3d([0],[1],[100], xlims=(-100,100),ylims=(-100,100), zlims=(-100,100),c=:red,markersize=5)

when plotted will make z coordinate to zero.

I am using Julia 1.5.0. This problem started occurring once my project.toml got wiped (my mistake). But I installed the same packages from start but the problem still persists. Any help would be much appreciated since I need this for my publication which is in just two days. For clarification, this was working before I did that mistake of wiping the project.toml.

I’m seeing the same behavior as you with PyPlot, but not with GR or PGFPlots or PGFPlotsX, so it seems like you have options! :grin:

  • Yeah. But this was part of the animation which I was doing, I tried plotlyjs for that animation, but the xlims, ylims and zlims aren’t working there. So that animation does not look good.

  • the package I used is this- using Plots; plotlyjs(),

  • Tried gr() also for this but the look of the animation is not that great.

  • For the animation, I am using “anim” from plots.jl to save as gif.

So any ideas on fixing the x,y,z limits in plotlyjs().

I don’t have any experience with plotlyjs. Can you be more specific about what didn’t look good vs. what you wanted to see?

Sorry about that. Looking good means that the axes(x,y,z) are not visible properly (May it is always the case with gr()). Thanks for pointing out to other packages. :+1:. At least its working.

There’s all kinds of way to customize the axes, so whatever problems you’re seeing may be fixable.

Yeah. I am able to customize the axis. I used xticks ,yticks and zticks. it looks well with grid. Is this how we enable the grids in the plot right?

If it worked, then yes…!
Here is a full list of attributes you can manipulate. Most backends support most of them (but not all).
https://docs.juliaplots.org/latest/generated/attributes_axis/