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

rasterize wavefield by default #284

Open
Thomas-Ulrich opened this issue Oct 6, 2021 · 1 comment
Open

rasterize wavefield by default #284

Thomas-Ulrich opened this issue Oct 6, 2021 · 1 comment

Comments

@Thomas-Ulrich
Copy link
Contributor

I would like to propose a very small enhancement to the plotting routines.
Recently, I generated publication-quality figures with geoclaw.
For that I needed to generate a snapshot of a tsunami simulation in a vectorized format (e.g. svg or pdf).
I only needed the text and axes to be vectorized, not the wavefield.
But using plotdata.print_format = 'svg' vectorized all data (and lead to a SVG file of 30Mb).
Therefore, I did the following change:

diff --git a/src/python/visclaw/frametools.py b/src/python/visclaw/frametools.py
index 9e20d52..dd6f127 100644
--- a/src/python/visclaw/frametools.py
+++ b/src/python/visclaw/frametools.py
@@ -791,6 +791,7 @@ def plotitem2(framesoln, plotitem, current_data, stateno):
             pcolor_cmd += ", edgecolors=pp['celledges_color']"
         else:
             pcolor_cmd += ", shading='flat'"
+        pcolor_cmd += ", rasterized=True"
 
         pcolor_cmd += ", **pp['kwargs'])"

Maybe it could be nice to integrate this change?

more info about the rasterization in matplotlib: https://matplotlib.org/devdocs/gallery/misc/rasterization_demo.html

@mandli
Copy link
Member

mandli commented Oct 6, 2021

Sounds like a good idea to me.

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