Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PS file size not so "reasonable" with plot3d #6838

Open
joa-quim opened this issue Jun 30, 2022 · 1 comment
Open

PS file size not so "reasonable" with plot3d #6838

joa-quim opened this issue Jun 30, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@joa-quim
Copy link
Member

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
@joa-quim joa-quim added the bug Something isn't working label Jun 30, 2022
@joa-quim joa-quim changed the title PS file size no so "reasonable" with plot3d PS file size not so "reasonable" with plot3d Jun 30, 2022
@PaulWessel
Copy link
Member

Yep that is a bit crazy. Cannot recall why any of that is necessary for a point (-Sp) though. But even if it is, we could probably

  • Drop some decimals
  • Add a short PR macros that means "matrix currentmatrix def"
  • And if only that last coeff changes figure out a way to just set that and not reset all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants