GMTInvalidInput: Unrecognized parameter 'sizes'

Hello folks,
in a very simples command using plot3D, this error is arising:

    fig.plot3d(x=500000,y=7700000,z=-track.bot[0],
               sizes=(track.top[0]-track.bot[0]),
               region=region+[-3500,0],
               perspective=[135,30],
               projection='X12c',
               style='u0.3c',
               color='red',
               zsize='5c'
              )

GMTInvalidInput: Unrecognized parameter ‘sizes’.

With “sizes” (and according to several tutorials) I should be able to control the size of the cube, however… strange that what appears is as if this option is invalid.

I just ran the tutorial from https://www.pygmt.org/v0.2.1/gallery/plot/scatter3d.html#sphx-glr-gallery-plot-scatter3d-py and got the same problem.

Any idea ?

ops ! just saw it changed to “size” in the latest version :slight_smile:
However the problem changed to

TypeError: len() of unsized object

You should look at a more recent version of the Gallery. It is up to v 0.7 now:

I am not a Python expert, but region=region+[-3500,0], does not look like good Python usage to me.

“region+[-3500,0]” works fine. It’s not the problem.
I just realized any dimension in “size” must be part of the region (humm).

From the v0.7 version of the manual:
size (1d array) – The size of the data points in units specified in style. Only valid if using x/y/z.

I think you need to make it an array, even if it has only one value by adding [] around it.

I can assure you that I don’t need to. When I remove plot3d from the script it works perfectly with the region delimiting by “region+[-3500,0]”. This is 100% python.

I tested the plot3d here and the len() issue is because the “size” is related to the “zscale” (conflicting with zsize) and how the “style” is defined (which cannot have fixed the size of the symbols).

So…I’m working around this. But thanks for your suggestions.

The solution was to use text but still in 3D (not a 2D plain text over 3D figure). But thanks to @maxrjones for the idea. By now, I’m using am overlaying basemap and write the labels in 2D.