7
$\begingroup$

For those familiar with more of these tools than I am, what are the pros and cons of the various tools available? Right now I exclusively use Tecplot for CFD visualization, but it leaves a lot to be desired. The vector graphics are okay, but not great, and it's not clear to me how to have the fonts be correctly generated raw by LaTeX. For 2D lineplots I prefer python/matplotlib for pgf graphics with great LaTeX operability, but python lacks flowfield visualization stuff. Scripting in Tecplot is okay, and reproducing identical figures but with different data is pretty easy by recording macros and editing them. It's also very easy to get up and running. Paraview and visit I haven't used for anything nontrivial, and they seem to have a high barrier to entry.

For me, matplotlib takes a little more learning to get started, but after that you can produce excellent publication quality vector plots in the blink of an eye, far faster and better than in Matlab. Is it possible to do the same with paraview or visit compared to Tecplot?

In other words, if you had a new PhD student what would you push them towards for the best quality figures, and what would your workflow look like?

$\endgroup$
1
  • 1
    $\begingroup$ If you insist in generating vector graphics from your 3D scenes. I would suggest you to check gl2ps. That is the tool behind the new vector export option in Paraview. $\endgroup$
    – nicoguaro
    Commented Mar 2, 2016 at 17:40

2 Answers 2

7
$\begingroup$

I'd venture the guess that most people in computational science use either Visit or Paraview for flow visualizations. These are simply the two most widely used programs I use.

It's true that there is a bit of a barrier in the beginning, but my students are quite proficient after using it for a class period or two. If you want to see an interactive demonstration of how they are used, take a look at videos 11 and 32 here: http://www.math.colostate.edu/~bangerth/videos.html

$\endgroup$
7
  • $\begingroup$ Do you know if their vector graphics outputs play nicely with LaTeX? I cringe when I see mismatching font types/sizes compared to the text. That's one thing I love about matplotlib & pgf output - I can scale to any size and the fonts and markers and ticks all scale properly. When I see Visit/Paraview/Tecplot figures in most publications, it's painfully obvious what they used and they often look shabby and out of place, but I'm not sure if that's user error/laziness. $\endgroup$
    – Aurelius
    Commented Feb 16, 2016 at 14:54
  • 1
    $\begingroup$ I will admit that I've never tried to create vector graphics with either. That pictures look shabby is, however, always user laziness -- it takes time to create good graphics, but that's true for any program. $\endgroup$ Commented Feb 16, 2016 at 15:15
  • $\begingroup$ Doing some searching, it looks like visit doesn't support vector graphics at all, which seems like a strange feature to be missing. $\endgroup$
    – Aurelius
    Commented Feb 16, 2016 at 15:34
  • $\begingroup$ @WolfgangBangerth do you have any recent experience with the Python interfaces to both VisIt and Paraview? I have looked into both in the past and ran the other direction because of this. $\endgroup$ Commented Feb 16, 2016 at 20:00
  • $\begingroup$ @KyleMandli, no, never tried it. Sorry. $\endgroup$ Commented Feb 16, 2016 at 22:47
4
$\begingroup$

I don't know why do you want vector graphics for your visualizations. It works ok for 2D cases, but in 3D I believe that there is need for raster images. In Paraview you can export to PDF, for example. Also, you might find Mayavi interesting. The next example generates a vector image (use with caution this simple example is 1.8 MB).

import numpy as np
from mayavi import mlab

# Test data: Matlab `peaks()`
x, y = np.mgrid[-3:3:50j,-3:3:50j]
z =  3*(1 - x)**2 * np.exp(-x**2 - (y + 1)**2) \
   - 10*(x/5 - x**3 - y**5)*np.exp(-x**2 - y**2) \
   - 1./3*np.exp(-(x + 1)**2 - y**2) 

surf = mlab.surf(x, y, z, colormap='RdYlBu', warp_scale=0.3, representation='wireframe', line_width=0.5)
mlab.outline(color=(0, 0, 0))
axes = mlab.axes(color=(0, 0, 0), nb_labels=5)
axes.title_text_property.color = (0.0, 0.0, 0.0)
axes.title_text_property.font_family = 'times'
axes.label_text_property.color = (0.0, 0.0, 0.0)
axes.label_text_property.font_family = 'times'
mlab.savefig("vector_plot_in_3d.pdf")
mlab.show()

enter image description here

As a final comment, I would say that you can generate good visualizations in Mayavi/Paraview, Tecplot or matplotlib, but you will have to invest some time.

Here some examples in Paraview:

enter image description here

enter image description here

http://www.paraview.org/gallery/

$\endgroup$
7
  • 1
    $\begingroup$ I don't get why anyone wouldn't want vector graphics for plots. If you ever have to resize a rasterized plot for a publication, either (a) you have to totally regenerate it, or (b) you just scale it, leading to improperly small text if shrinking, or overly large pixelated text and poor dpi if magnifying. And you're stuck with the font that's in the raster image. I do like paraview's feature that enables an EPS with rasterized graphics but plaintext characters though. That's a good compromise. For your answer to work, I'm interested in the workflow/settings for nontrivial 3D flowfields. $\endgroup$
    – Aurelius
    Commented Feb 17, 2016 at 14:06
  • 2
    $\begingroup$ @Aurelius, I understand the goodness of vector graphics. But I find them less interesting for 3D visualizations, they just generate so much entities that make a pain opening the files. For what you mention you can annotate raster graphics, or just link their generation to the LaTeX file (regenerating them when you need to rescale or move things around). $\endgroup$
    – nicoguaro
    Commented Feb 17, 2016 at 14:26
  • $\begingroup$ @Aurelius, do you find this [magnetic field example] (docs.enthought.com/mayavi/mayavi/auto/…) nontrivial? If yes, you can check the gallery of Mayavi. $\endgroup$
    – nicoguaro
    Commented Feb 17, 2016 at 14:28
  • 1
    $\begingroup$ @nicoguaro's point is exactly what it boils down to: for 3d visualizations, you quickly end up with a few 10MB of data per picture. You can't make papers out of this that render in a reasonable amount of time. $\endgroup$ Commented Feb 17, 2016 at 20:16
  • 1
    $\begingroup$ I agree with @nicoguaro that vector plots are prohibitive for these kinds of plots. If you get into the habit of always having scripts for generating your plots, it is easy not only to change the size afterwards, but also to change, e.g., the aspect ratio or color of some part when your referee asks you to. $\endgroup$
    – sigvaldm
    Commented Jun 26, 2020 at 6:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.