[Mesa-users] [EXT] Pgplot - how to produce pdf plots?
Renzo, Mathieu - (mrenzo)
mrenzo at arizona.edu
Sat Aug 24 19:50:21 UTC 2024
Yes that should be possible with this flag (and there is a separate one for the "on screen" plots):
https://docs.mesastar.org/en/latest/reference/pgstar.html#file-white-on-black-flag
In general, try to have a look in the files in $MESA_DIR/star/defaults/ for the options available (and their default values), or equivalently the online docs. You may answer many of your own questions much faster!
Cheers,
Mathieu
>From tiny keyboard
________________________________
From: Pau A.S. <lamarededeusenyor at googlemail.com>
Sent: Saturday, August 24, 2024 12:35 PM
To: Renzo, Mathieu - (mrenzo) <mrenzo at arizona.edu>
Cc: mesa-users <mesa-users at lists.mesastar.org>
Subject: Re: [Mesa-users] [EXT] Pgplot - how to produce pdf plots?
External Email
________________________________
Thanks! I'm getting what I wanted. I have a final question... Can I tell pgplot to use a white background instead of a black one in the trho_profile files??
On Sat, 24 Aug 2024, 17:50 Mathieu Renzo, <mrenzo at arizona.edu<mailto:mrenzo at arizona.edu>> wrote:
This depends on what plot you are trying to save. For each of them there is a *_file_dir entry in the inlist_pgstar that you can customize. This is the sub-directory of the work directory where the pgstar files will be saved.
For example, for an HR diagram that would be `HR_file_dir`, which is by default set to `png`, so with the changes suggested above by Rich I get the files in hr_000005.eps in my work directory/png (but you may change this to any other subdirectory you want).
So unless you have changed the *_file_dir explicitly, your eps will be inside the default folder which is probably called `png`.
To save only the last one you could catch the stopping criterion of your model in your run_star_extras.f90 and call the function defined in star_lib called pgstar_write_plot_to_file (but I have not tested this).
I hope this helps!
Mathieu
On 8/24/24 08:30, Pau A.S. wrote:
External Email
________________________________
I am sorry but I don't see where the eps is being created. I did the suggested modifications but I don't see any eps creates after
$ ./rn
In particular I'm interested in the last one.
What am I doing wrong?
On Fri, 23 Aug 2024, 23:49 Mathieu Renzo via Mesa-users, <mesa-users at lists.mesastar.org<mailto:mesa-users at lists.mesastar.org>> wrote:
Hi Pau,
To add to Rich's answer, from $MESA_DIR/star/defaults/pgstar.defaults it appears you can make pgplot output pdf directly. However, this is also *incorrect*! Thanks for bringing our attention to this, we will improve the documentation on this in future releases.
What is currently that file:
! File output
! -----------
! file_device
! ~~~~~~~~~~~
! file_extension
! ~~~~~~~~~~~~~~
! 'png' is Portable Network Graphics format; can also use 'pdf'
! ::
file_device = 'png'
file_extension = 'png'
This may make one think that you can achieve what you want just setting `file_device` and `file_extension` to pdf. I tested this and it does not work.
However, as a workaround, what does work is to set those two options to `ps` (for postscript), or go the way Rich suggested. As he said, ps and eps are vector formats too, and should be easy to convert them to pdf afterwards.
Cheers,
Mathieu
On 8/23/24 14:02, Pau A.S. via Mesa-users wrote:
External Email
________________________________
Dear all...
I was wondering whether there's a tool to produce a pdf of the last instant of output that pgplot produces on the screen, but of better quality, maybe with python?
Those two plots are very informative and it would be nice to have them on pdf to explain things to students, etc
Thanks!
_______________________________________________
mesa-users at lists.mesastar.org<mailto:mesa-users at lists.mesastar.org>
https://lists.mesastar.org/mailman/listinfo/mesa-users<https://lists.mesastar.org/mailman/listinfo/mesa-users>
--
Mathieu Renzo<https://users.flatironinstitute.org/~mrenzo/>
Assistant Professor
University of Arizona & Steward Observatory
_______________________________________________
mesa-users at lists.mesastar.org<mailto:mesa-users at lists.mesastar.org>
https://lists.mesastar.org/mailman/listinfo/mesa-users<https://lists.mesastar.org/mailman/listinfo/mesa-users>
--
Mathieu Renzo<https://users.flatironinstitute.org/~mrenzo/>
Assistant Professor
University of Arizona & Steward Observatory
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20240824/c7d2724e/attachment.htm>
More information about the Mesa-users
mailing list