Plot field with desired color map scale and automatically save it in a picture format (png for instance)

8 months ago by
Hello everyone,
Is this possible using the FEniCS plot command (or another)  to plot a solution field and set automatically:
- the color map scale
- the view axis
- save the picture in a specified path

I am not speaking about saving the field in a xml or a pvd format, simply take a screenshot of the solution field picture.

I am solving a time-dependent problem and i would like that at each step i get a picture of the field, numerated with the iteration number. Then, i can make an animation of the solution with another software. So that i do not have to save pvd file for each time step, which is memory expensive. I am thinking of saving the solution fields with different point of view at each time, so that i still have a good visualization of the solution.

Seems it is possible to save plot figure (post below), but how to handle color map and point of view?


Community: FEniCS Project

1 Answer

8 months ago by
You can do stuff like that, sure.  Here's my helpity helper:

for some fun plotting like this:

File attached: p_rat_31.pdf (276.41 KB)
File attached: rho_A31.pdf (244.95 KB)

File attached: rho_C31.pdf (244.44 KB)
File attached: rho_W31.pdf (243.95 KB)
File attached: T31.pdf (245.51 KB)
File attached: U_31.pdf (335.63 KB)

Thanks, i will try your fenics_viz.
Does it work with MPI parallelized code ? (the plot command in fenics show one plot for each partitioned mesh).
written 7 months ago by Francois Usseglio Viretta  
Please login to add an answer/comment or follow this question.

Similar posts:
Search »