[Paraview] tikz/tex export for paraview contour plots

Richard Pichler pichler.richard at gmail.com
Sun May 8 20:50:30 EDT 2016


Hi,

We are currently trying to export paraview contour plots and include
them into a latex document. The straight forward way of exporting an eps
or similar image has some issues. In particular the axis are not scaling
with the camera view, hence, if you zoom in, you don't get them on the
plot since they are only at the exterior of the data. We created a small
python tool, that essentially embeds the figure created in paraview into
a tikz picture and adds axes. However, we still need to manually specify
the the extent of the plot in that script which is tedious.

a) Did anyone encounter the same issue and is willing to share a script
or so?
b) If not, is there a way to extract the Viewport extent in a python
script so that we can directly set them in the script?
c) In addition it would be great if also the text in the legend would be
rendered in latex. Therefore it would be great if we could place it in
the Paraview window and then only plot the colorbar and add the text to
the tikz file.

Thanks,
Richard

PS: the core of the python script that prepares the tikz file:

ifile=open(outfilename,'w')
formstring=' {:>10.8f}'
line='% this picture was created with the axisNlable_generator.py script
\n'\
+    '% \n \n'
ifile.write(line)
line='\\begin{tikzpicture} \n' \
+    '\\begin{axis}[ \n' \
+    'axis on top,enlargelimits=false,\n'\
+    'width=\\figurewidth, \n' \
+    'axis equal image,\n'\
+    'xlabel='+xlabel+',\n'\
+    'ylabel='+ylabel+']\n'\
+    '\\addplot[]
graphics[xmin='+str(xmin)+',ymin='+str(ymin)+',xmax='+str(xmax)+',ymax='+str(ymax)+']\n'
\
+    '{'+enbed_fname+'};\n'\
+    '\\end{axis} \n' \
+    '\\end{tikzpicture} \n' \

ifile.write(line)
ifile.close()


More information about the ParaView mailing list