[Mesa-users] [EXT] Pgplot - how to produce pdf plots?
Mathieu Renzo
mrenzo at arizona.edu
Sat Aug 24 15:50:42 UTC 2024
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> 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
>> 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
> 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/8076bc2e/attachment.htm>
More information about the Mesa-users
mailing list