GenericMappingTools / GenericMappingTools/gmt

PS file size not so "reasonable" with plot3d

Open
#6,838 1 comment 1 reaction 0 assignees View on GitHub
bug
Dominant language
C
Stars
979
Forks
414
Avg merge
17h 26m
Merged PRs (30d)
54

Description

Those guys that wanted Laz in GMT lead me to find this about ps file sizes when doing plot3d. In the case of the laz file (~2e^6 points) the plotd3 ps was about 411 MB. Quite big.

With a synthetic case these two have a bout the same size (~25 kB) but curiously with 2e^6 points the ``plot3d`` ps had ~50 Mb whilst the ``plot`` had ~70 Mb

```
julia> plot(rand(100,100,3), zsize=5, marker=:point, show=1, Vd=1)
psxy -JX14c/9.5c -Baf -BWSen -JZ5 -R0/1/0/1 -Sp2p -P -K > C:\TEMP\GMTjl_tmp.ps

julia> plot3d(rand(100,100,3), zsize=5, view=(180,90), marker=:point, show=1, Vd=1)
psxyz -JX14c/9.5c -Baf -Bza -JZ5 -p181/90 -R-0.04/1.04/0.02/1/0.00287271009298/0.988599253628 -Sp2p -P -K
```
but the big difference comes when use perspective other then vertical. It only take to change ``view=(181,80)`` to ``view=(181,90)`` and the file size grows to 41.5 kB (with the 2e^6 points it was 411 MB).

The reason seems to be that now each point is plotted with what seems a kindof rotation matrix that uses 12 decimal places and where all but the last coefficient is repeated thru out the file

```
PSL_GPP setmatrix [0.999847695156 0.0171872651682 -0.0174524064373 0.984657762021 78.3296981831 390.130368759] concat
/PSL_setview matrix currentmatrix def
17 2925 881 Sp
PSL_GPP setmatrix [0.999847695156 0.0171872651682 -0.0174524064373 0.984657762021 78.3296981831 78.4282268572] concat
/PSL_setview matrix currentmatrix def
17 5502 830 Sp
PSL_GPP setmatrix [0.999847695156 0.0171872651682 -0.0174524064373 0.984657762021 78.3296981831 386.108559274] concat
/PSL_setview matrix currentmatrix def
17 1689 895 Sp
PSL_GPP setmatrix [0.999847695156 0.0171872651682 -0.0174524064373 0.984657762021 78.3296981831 345.888450474] concat
/PSL_setview matrix currentmatrix def
17 2782 861 Sp
PSL_GPP setmatrix [0.999847695156 0.0171872651682 -0.0174524064373 0.984657762021 78.3296981831 191.841944072] concat
/PSL_setview matrix currentmatrix def
17 306 893 Sp
PSL_GPP setmatrix [0.999847695156 0.0171872651682 -0.0174524064373 0.984657762021 78.3296981831 56.3854549359] concat
/PSL_setview matrix currentmatrix def
17 2307 850 Sp
PSL_GPP setmatrix [0.999847695156 0.0171872651682 -0.0174524064373 0.984657762021 78.3296981831 325.698711504] concat
/PSL_setview matrix currentmatrix def
17 2265 846 Sp
PSL_GPP setmatrix [0.999847695156 0.0171872651682 -0.0174524064373 0.984657762021 78.3296981831 51.9332934717] concat
/PSL_setview matrix currentmatrix def
17 3013 833 Sp
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.