gxhints - Graphics conversion hints Wiki
Hints for graphics conversion, gxhconvert script
Brought to you by:
kraused
← TOC | ↑ Home | Gnuplot | → | TeX | TeX | EPS | SVG | PNG | JPEG |
This page shows how to convert a Gnuplot file named x.gp into a JPEG image.
Are you sure you want to convert to JPEG?
PNG normally would be the better choice.
When converting vector graphics (like Gnuplot) to bitmap images (like JPEG) you have to specify a resolution. This is the number of pixels per inch.
When creating JPEG files a quality parameter is required for the compromise between file size and image quality.
Typically the value is in the range 80...95.
Values below 25 and above 98 are not recommended.
set terminal ... set output ...in Gnuplot files you want to use with gxhconvert.
## width = 10cm ## height = 10cm set xrange [0:10] plot x*x title "\\(y=x^2\\)"The gxhconvert script uses the tikz terminal instead of the usual cairolatex pdf terminal if width and height are specified. Make sure you have installed the "gnuplot-lua-tikz" package for LaTeX.
## terminal = tikz ## terminal setup = solidFor the terminal you can choose either "tikz" or "cairolatex".
set xlabel "\\(\\frac{x}{x_0}\\rightarrow\\)" set ylabel "\\(\\overset{\\uparrow\\vspace{0.3em}}{y}\\)" rotate by 0Note: The \overset instruction requires a line
preamble line = \usepackage{amsmath}in the gxhconvert.conf file in the current working directory.
gxhconvert -o=jpg -r=_resolution_ -q=_quality_ x.gp
See the [gxhconvert manual] for a full description of the gxhconvert script.
Option | Purpose |
---|---|
--pgf | Use PGF instructions in the intermediate *.tex file instead of including a *.pdf file. |
--interlaced --jpeg‑progressive |
Create progressive JPEG. The start of the file (data stream) allows to render the image in low quality, details for better quality follow. |
--optimized --jpeg‑optimize |
Optimize (decrease) file size. Computation takes a little longer and uses more memory. |
--web | Shortcut for "--interlaced --optimized ". |
gnuplot -e "set terminal cairolatex pdf standalone ; set output 'x.tex'" x.gp pdflatex -interaction=nonstopmode x pdftoppm -r _resolution_ x.pdf | pnmtojpeg -quality=_quality_ > x.jpg
gnuplot -e "set terminal tikz standalone plotsize 10cm,7cm ; set output 'x.tex'" x.gp pdflatex -interaction=nonstopmode x pdftoppm -r _resolution_ x.pdf | pnmtojpeg -quality=_quality_ > x.jpg
← TOC | ↑ Home | Gnuplot | → | TeX | TeX | EPS | SVG | PNG | JPEG |