Skip to content

Symbols are sized in unit inches instead of centimetres when using -i #4386

@weiji14

Description

@weiji14

Description of the problem

There appears to be a bug (or feature?) when using i="0,1,2,2" with -Suc, as it doesn't change the unit to centimetres, but keeps on using inches as the default unit. The documentation at https://docs.generic-mapping-tools.org/latest/plot3d.html#s confuses me, especially with the mention of PROJ_LENGTH_UNIT.

Originally posted by @weiji14 in GenericMappingTools/pygmt#471 (comment)

Full script that generated the error

Data file from https://github.com/GenericMappingTools/pygmt/blob/v0.2.0/pygmt/tests/data/points.txt

gmt begin temp png
  gmt plot3d pygmt/tests/data/points.txt -Jz5 -p225/30 -i0,1,2,2 -R10/70/-5/10/0/1 -JX4i -Suc -Gblue -Baf -Bzaf
gmt end show

Full error message

gmt [DEBUG]: Obtained the ppid from parent: 23207
gmt [DEBUG]: Enter: gmtinit_new_GMT_ctrl
gmt [DEBUG]: GMT->session.SHAREDIR = ~/miniconda3/envs/pygmt/share/gmt
gmt [DEBUG]: GMT->session.HOMEDIR = ~
gmt [DEBUG]: GMT->session.USERDIR = ~/.gmt [created]
gmt [DEBUG]: GMT->session.CACHEDIR = ~/.gmt/cache [created]
gmt [DEBUG]: GMT: 0. Will try to find subdir=postscriptlight stem = PSL_custom_fonts suffix=.txt
gmt [DEBUG]: GMT: 1. gmt_getsharepath trying current dir
gmt [DEBUG]: GMT: 2. gmt_getsharepath trying USERDIR ~/.gmt
gmt [DEBUG]: GMT: 3. gmt_getsharepath trying USERDIR subdir ~/.gmt/postscriptlight
gmt [DEBUG]: GMT: 4. gmt_getsharepath trying SHAREDIR subdir ~/miniconda3/envs/pygmt/share/gmt/postscriptlight
gmt [DEBUG]: GMT: 5. gmt_getsharepath trying SHAREDIR ~/miniconda3/envs/pygmt/share/gmt
gmt [DEBUG]: GMT: 6. gmt_getsharepath failed
gmt [DEBUG]: Map distance calculation will be Cartesian
gmt [DEBUG]: Exit:  gmtinit_new_GMT_ctrl
gmt [DEBUG]: Enter: New_PSL_Ctrl
gmt [DEBUG]: Exit:  New_PSL_Ctrl
gmt [DEBUG]: Enter: gmt_manage_workflow
gmt [DEBUG]: GMT now running in modern mode [Session ID = 23207]
gmt [DEBUG]: Exit : gmt_manage_workflow
gmt [DEBUG]: Enter: PSL_beginsession
gmt [DEBUG]: Exit : PSL_beginsession
gmt [DEBUG]: Enter: PSL_setdefaults
gmt [DEBUG]: Exit : PSL_setdefaults
gmt [DEBUG]: Enter: gmtlib_io_init
gmt [DEBUG]: Exit : gmtlib_io_init
gmt [DEBUG]: Enter: gmt_hash_init
gmt [DEBUG]: Exit:  gmt_hash_init
gmt [DEBUG]: Enter: gmt_hash_init
gmt [DEBUG]: Exit:  gmt_hash_init
gmt [DEBUG]: Enter: gmt_reload_settings
gmt [DEBUG]: The PROJ_GEODESIC set to Vincenty
gmt [DEBUG]: gmtlib_get_graphics_item: Fig: 0 Subplot: 2 Panel: () Inset: 0
gmt [DEBUG]: Reading GMT Default parameters from file: ~/.gmt/sessions/gmt_session.23207/gmt.conf
gmt [DEBUG]: Exit:  gmt_reload_settings
gmt [DEBUG]: Enter: gmtlib_plot_C_format
gmt [DEBUG]: Exit:  gmtlib_plot_C_format
gmt [DEBUG]: Enter: gmtinit_get_history
gmt [DEBUG]: gmtlib_get_graphics_item: Fig: 0 Subplot: 2 Panel: () Inset: 0
gmt [DEBUG]: Initialize FFTW with 2 threads.
gmt [DEBUG]: GMT_Create_Session initialized GMT structure
gmt [DEBUG]: Loading core GMT shared library: libgmt.so
gmt [DEBUG]: Shared Library # 0 (core). Path = libgmt.so
gmt [DEBUG]: Loading GMT plugins from: ~/miniconda3/envs/pygmt/lib/gmt/plugins
gmt [DEBUG]: Shared Library # 1 (supplements). Path = ~/miniconda3/envs/pygmt/lib/gmt/plugins/supplements.so
gmt [DEBUG]: GMT now running in modern mode [Session ID = 23207]
gmt [DEBUG]: Use PS filename ~/.gmt/sessions/gmt_session.23207/gmt_0.ps-
gmt [DEBUG]: gmtinit_get_current_panel: No current panel selected so not in subplot mode
gmt [DEBUG]: Revised options: pygmt/tests/data/points.txt -Jz5 -p225/30 -i0,1,2,2 -R10/70/-5/10/0/1 -JX4i -Suc -Gblue -Baf -Bzaf -Vd
plot3d [DEBUG]: History: Process -Jz5
plot3d [DEBUG]: History: Process -p225/30
plot3d [DEBUG]: History: Process -R10/70/-5/10/0/1
plot3d [DEBUG]: History: Process -JX4i
plot3d [DEBUG]: gmt_get_filename: In: 10/70/-5/10/0/1 Out: 10/70/-5/10/0/1
plot3d [DEBUG]: Look for file 10/70/-5/10/0/1 in ~/.gmt
plot3d [DEBUG]: Look for file 10/70/-5/10/0/1 in ~/.gmt/cache
plot3d [DEBUG]: Look for file 10/70/-5/10/0/1 in ~/.gmt/server
plot3d [DEBUG]: Got regular w/e/s/n for region (10/70/-5/10/0/1)
plot3d [DEBUG]: gmt_get_filename: In: pygmt/tests/data/points.txt Out: pygmt/tests/data/points.txt
plot3d [DEBUG]: Found readable file pygmt/tests/data/points.txt
plot3d [DEBUG]: Replace file pygmt/tests/data/points.txt with path pygmt/tests/data/points.txt
plot3d [DEBUG]: Replace file pygmt/tests/data/points.txt with pygmt/tests/data/points.txt
plot3d [INFORMATION]: Processing input table data
plot3d [DEBUG]: Projected values in meters: 10 70 -5 10
plot3d [DEBUG]: Auto-frame interval for axis 0 item 0: d = 20  f = 10
plot3d [INFORMATION]: Auto-frame interval for x-axis (item 0): a20f10
plot3d [DEBUG]: Auto-frame interval for axis 1 item 0: d = 5  f = 1
plot3d [INFORMATION]: Auto-frame interval for y-axis (item 0): a5f1
plot3d [DEBUG]: Auto-frame interval for axis 2 item 0: d = 0.2  f = 0.1
plot3d [INFORMATION]: Auto-frame interval for z-axis (item 0): a0.2f0.1
plot3d [INFORMATION]: Map scale is 0.00590551 km per cm or 1:590.551.
plot3d [DEBUG]: 3-D shading illusion: lux[k] = 0.5
plot3d [DEBUG]: 3-D shading illusion: lux[k] = 0.5
plot3d [DEBUG]: 3-D shading illusion: lux[k] = 0.316497
plot3d [DEBUG]: Running in PS mode modern
plot3d [DEBUG]: Use PS filename ~/.gmt/sessions/gmt_session.23207/gmt_0.ps-
plot3d [DEBUG]: Create hidden PS file ~/.gmt/sessions/gmt_session.23207/gmt_0.ps-
plot3d [DEBUG]: No figure file ~/.gmt/sessions/gmt_session.23207/gmt.figures - nothing to do
plot3d [DEBUG]: Got session name as temp and default graphics formats as png
plot3d [DEBUG]: gmtapi_init_import: Passed family = Data Table and geometry = Point
plot3d [DEBUG]: gmt_get_filename: In: pygmt/tests/data/points.txt Out: pygmt/tests/data/points.txt
plot3d [DEBUG]: Found readable file pygmt/tests/data/points.txt
plot3d [DEBUG]: Replace file pygmt/tests/data/points.txt with path pygmt/tests/data/points.txt
plot3d [DEBUG]: gmt_get_filename: In: pygmt/tests/data/points.txt Out: pygmt/tests/data/points.txt
plot3d [DEBUG]: gmt_get_filename: In: pygmt/tests/data/points.txt Out: pygmt/tests/data/points.txt
plot3d [DEBUG]: Found readable file pygmt/tests/data/points.txt
plot3d [DEBUG]: Object ID 0 : Registered Data Table File pygmt/tests/data/points.txt as an Input resource with geometry Point [n_objects = 1]
plot3d (gmtapi_init_import): tried to free unallocated memory
plot3d [DEBUG]: gmtapi_init_import: Added 1 new sources
plot3d [DEBUG]: GMT_Init_IO: Returned first Input object ID = 0
plot3d [DEBUG]: GMT_Begin_IO: Mode value 1 not considered (ignored)
plot3d [DEBUG]: GMT_Begin_IO: Initialize record-by-record access for Input
plot3d [DEBUG]: gmtapi_next_io_source: Selected object 0
plot3d [DEBUG]: gmt_get_filename: In: pygmt/tests/data/points.txt Out: pygmt/tests/data/points.txt
plot3d [DEBUG]: Found readable file pygmt/tests/data/points.txt
plot3d [DEBUG]: Replace file pygmt/tests/data/points.txt with path pygmt/tests/data/points.txt
plot3d [DEBUG]: Found readable file pygmt/tests/data/points.txt
plot3d [DEBUG]: Found readable file pygmt/tests/data/points.txt
plot3d [INFORMATION]: Reading Data Table from file pygmt/tests/data/points.txt
plot3d [DEBUG]: GMT_Begin_IO: Input resource access is now enabled [record-by-record]
plot3d [DEBUG]: Source col types: (Number,Number,Number)
plot3d [DEBUG]: ASCII source scanned: Numerical columns: 3, Trailing text: N, Record type: Numerical only
plot3d [DEBUG]: Selected col types: (Number,Number,Number,Dimension)
plot3d [DEBUG]: dist[0] = -2.63871 dist[1] = 0.522539
plot3d [DEBUG]: dist[0] = -2.23226 dist[1] = 0.375689
plot3d [DEBUG]: dist[0] = -3.44896 dist[1] = 0.764173
plot3d [DEBUG]: dist[0] = -3.04301 dist[1] = 0.907677
plot3d [DEBUG]: dist[0] = -2.89292 dist[1] = 0.330512
plot3d [DEBUG]: dist[0] = -3.26392 dist[1] = 0.864173
plot3d [DEBUG]: dist[0] = -3.30405 dist[1] = 0.138976
plot3d [DEBUG]: dist[0] = -2.60377 dist[1] = 0.457382
plot3d [DEBUG]: dist[0] = -1.52854 dist[1] = 0.36811
plot3d [DEBUG]: dist[0] = -2.73579 dist[1] = 0.315354
plot3d [DEBUG]: dist[0] = -0.861251 dist[1] = 0.891043
plot3d [DEBUG]: dist[0] = -2.41184 dist[1] = 0.44439
plot3d [DEBUG]: dist[0] = -3.69802 dist[1] = 0.871752
plot3d [DEBUG]: dist[0] = -3.67568 dist[1] = 0.463287
plot3d [DEBUG]: dist[0] = -1.42263 dist[1] = 0.365551
plot3d [DEBUG]: dist[0] = -2.7133 dist[1] = 0.907972
plot3d [DEBUG]: dist[0] = -1.89403 dist[1] = 0.750197
plot3d [DEBUG]: dist[0] = -3.65232 dist[1] = 0.42372
plot3d [DEBUG]: dist[0] = -2.52177 dist[1] = 0.919094
plot3d [DEBUG]: dist[0] = -2.59005 dist[1] = 0.5875
plot3d [DEBUG]: GMT_End_IO: Input resource access is now disabled
plot3d [DEBUG]: Current size of half-baked PS file ~/.gmt/sessions/gmt_session.23207/gmt_0.ps- = 32322.
plot3d [DEBUG]: gmtlib_unregister_io: Unregistering object no 0 [n_objects = 0]
plot3d (gmtlib_free_tmp_arrays): tried to free unallocated memory
gmt [DEBUG]: Entering GMT_Destroy_Session
gmt [DEBUG]: gmtlib_get_graphics_item: Fig: 0 Subplot: 2 Panel: () Inset: 0

Actual outcome

Cubes sized in inches are produced instead of in centimetres

temp

Expected outcome

Cubes sized in centimetres (note smaller, as 1 inch = ~2.5 cm)

temp

System information

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions