|
[Sponsors] |
How to export Paraview images that fit Latex requirements |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 24, 2020, 08:27 |
How to export Paraview images that fit Latex requirements
|
#1 |
Senior Member
MA
Join Date: Mar 2020
Posts: 163
Rep Power: 6 |
Hi,
I am exporting the images from the Paraview to Latex but it seems that images are large in size when pasted in Latex Window. I looked for the options to reduce the screen size in Paraview but couldn't find it. Any suggestions please? |
|
August 28, 2020, 07:00 |
|
#2 | |
Senior Member
Sebastian Engel
Join Date: Jun 2011
Location: Germany
Posts: 567
Rep Power: 21 |
Quote:
I'll assume that you exported some image format, such as png, and jpeg, and inserted into a latex WYSIWYG editor. If the exported image size is too large, you could scale down the resolution with third-party software, such as Gimp, ImageMagick, or any other image processor. Since you are using latex, you can declare your includegraphics with the width option to scale the image to the linewidth (or any other document spec). Such as: Code:
\includegraphics[width=\linewidth]{figure.png} |
||
September 3, 2020, 08:50 |
|
#3 | |
Senior Member
MA
Join Date: Mar 2020
Posts: 163
Rep Power: 6 |
Quote:
Thanks. I didn't use the script that you suggested because I was using "scale=0.X" while adding the figure. Sometimes I need to put two or even four pictures side by side so this scale helps but on the other hand, pixels are compromised. |
||
December 5, 2020, 11:02 |
|
#4 |
New Member
David Dudli
Join Date: Oct 2020
Location: Switzerland
Posts: 8
Rep Power: 6 |
I think there are way better options to include PV-Data in TeX-files. I mean, you could just export sceenshots, but you could as well use word do make your document in this case. I'm trying right now to find a quick way to do this without screenshots, hence using "Save Data".
Does anyone have experience to do that? I would like to see the legend in the latex-documents font, and also to be able choose the colors myself in latex. |
|
December 6, 2020, 17:47 |
|
#5 |
Senior Member
Sebastian Engel
Join Date: Jun 2011
Location: Germany
Posts: 567
Rep Power: 21 |
Instead of screenshots, export the scene. That way some overlayed elements can be exported vectorized. Though, lacking advanced experience with paraview, i dont know whether there is a way to completely export a scene vectorized---I doubt it.
The gl2ps library used to export scenes to eps, pdf, and svg practically can export strings to tex files. There are also some locations in the source, which do register that interface to paraview. I haven't investigated any further where the interface is calling these functions... A doable workaround is to save a scene as svg, and then use inkscape to further convert it export to pdf/... + latex. That way, you could at least have the legend in the font of your document. Letting latex actually recreate a picture with your own colors is likely out of scope of any document creators (including word). Maybe there is some fancy ways with tikz, metapost, or another specialized extension ... Going further offtopic, i remember to read something about embedding 3d models into pdfs is possible---to get an interactive document; have look here. But that requires some javascript magic which is likely not very portable. |
|
December 7, 2020, 05:15 |
|
#6 |
New Member
David Dudli
Join Date: Oct 2020
Location: Switzerland
Posts: 8
Rep Power: 6 |
Thanks for the quick reply!
Im just a windows user, hence no experience messing with any source code… Only using Paraview's GUI. Also, my document does not have to be perfect, I just hoped that there was a way to achieve this in a reasonable time. I found a way to import Paraview-visuals into latex docs using \usepackage{epstopdf}. That way you can import any *.eps-file you generated in Paraview (File>Export Scene>*.eps) via \includegraphics{*.eps}. Of course that is also possible with regular screenshots, but I think you can get vectorized visuals out out of there. I just couldn't figure out how by now, will repost when I have. The "fancy way" would be to eport the data as *.csv (table) and then set up the field(s) with \usepackage{pgfplots} which is way to time consuming in my case. Interactive would be next level difficult and in most of the time not even a quality improvement, but maybe someone sometime will do that. |
|
March 24, 2022, 18:16 |
|
#7 |
Senior Member
qutadah
Join Date: Jun 2021
Location: USA
Posts: 101
Rep Power: 5 |
you could also use the option "lock view size custom" from Tools menu in ParaView and screenshot size will be adjusted accordingly.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Guide: Writing Equations in LaTeX on the CFD Online Forums | pete | Site Help, Feedback & Discussions | 27 | May 19, 2022 04:19 |
[OpenFOAM.org] Compilation Error with OpenFOAM-5.x using Intel Compilers | aow | OpenFOAM Installation | 4 | April 25, 2019 17:17 |
[General] A "clean" solution to export binary ensight gold format from Fortran to Paraview? | flotus1 | ParaView | 1 | June 23, 2015 12:59 |
[General] Can ParaView Zoom to fit? | noah_r | ParaView | 0 | June 20, 2014 17:33 |
Paraview does not show any images | Thriceguy | OpenFOAM | 3 | April 17, 2011 21:20 |