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

How to finalize a PS #334

Closed
hydrocoast opened this issue Jan 29, 2020 · 2 comments
Closed

How to finalize a PS #334

hydrocoast opened this issue Jan 29, 2020 · 2 comments

Comments

@hydrocoast
Copy link
Contributor

Hi,

I would like to ask how to finalize a PS file when using GMT.jl functions such as GMT.coast and GMT.basemap, except for GMT.gmt.

The following returns an error due to not finalized PS:

julia> using GMT
julia> coast(J="X12/6", R="g", W=:thinnest)
julia> fname = GMT.fname_out(Dict())[1]
julia> psconvert("-TG -A -Fout.png  $fname")
psconvert [ERROR]: /tmp/GMTjl_tmp.ps: GMT PS format detected but file is not finalized. Maybe a -K in excess? out.png could be messed up.

This works properly since the -K option is turned off:

julia> gmt("pscoast -JX12/6 -Rg -Wthinnest -P > out.ps")
julia> psconvert("-TG -A -Fout.png  out.ps")

I thought it was good if GMT.psconvert works in the former condition, but no good idea occurs to me.
I am now watching functions set_KO and finalize_PS.

Thank you,

@joa-quim
Copy link
Member

Hi,
Don't do it that way. The default output is a file called GMT_tmp.ps that is written in your tmp directory. If you want to have it converted into another format then PS, use the fmt="format" specification. If you want to save under a different name use the savefig="fname" mechanism. So

using GMT
coast(J="X12/6", R="g", W=:thinnest, fmt="PNG", show=true)

or

coast(J="X12/6", R="g", W=:thinnest, savefig="out.PNG", show=true)
``

@hydrocoast
Copy link
Contributor Author

Thank you.
I missed the keyword arguments fmt= and savefig=. I get it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants