Gnuplot: gif unknown terminal - gnuplot

I am using Gnuplot v5.0 patchlevel 4.
I tried to use the gif terminal to make a gif animation see here. The problem is that I do not have the gif terminal among all the terminals. When I type set terminal gif animate delay 100 I received the error message: unknown or ambiguous terminal type. Here the list of my terminals
Subtopics available for set terminal:
cairolatex canvas cgm context
corel dumb dxf eepic
emf emtex epscairo epslatex
fig hpgl latex mf
mp pcl5 pdfcairo pngcairo
pop postscript pslatex pstex
pstricks push qms svg
tek40xx tek410x texdraw tgif
tkcanvas tpic vttek x11
xlib xterm
the tgif one is not working so, my question is, can I use/import in gnuplot a new terminal, such as the gif one ? Thanks

Related

Can graph with lines be generated in gnuplot in a linux terminal?

I want graphs with lines to be generated in gnuplot rather than points in a terminal. I have only terminal to work with and no gui interface (Centos).
i tried installing png/wxt terminal which failed. I want the output to be saved in a file but with lines unlike one with dumb terminal.
Displaying nice graphics in a terminal emulator window or on the bare linux console
The current recommendation for displaying graphics from gnuplot to the linux console (i.e. no windowing system at all) is to use a console terminal emulator such as yaft (https://github.com/uobikiemukot/yaft) that supports sixel graphics. With yaft as your console terminal you can run gnuplot and select set term sixel to generate very nice in-line graphics.
You can do essentially the same thing using xterm, so long as your copy of xterm was built with sixel graphics support. You must select the vt340 emulation mode. This allows in-line graphics generated by a remote machine that you have connected to via ssh.
$ xterm -ti 340
xterm> ssh some.remote.machine
[remote prompt] gnuplot
gnuplot> set term sixel
gnuplot> plot ...
Generating graphics to a file from a dumb terminal window
However none of this is necessary in order to create an output file from a terminal that is not capable of graphics. Gnuplot terminals png/tikz/pdf/postscript/emf/... etc all work without any requirement for terminal display. You can preview the plot with set term dumb and then switch to your prefered format for saving to a file.
set term dumb
plot sin(x) with lines # ugly plot but indicates ranges, etc
set term pdf
set output 'myplot.pdf'
replot

Ohm symbol shows in gnuplot wxt window, exported SVG from the window, but not in SVG term output

I have a sequence of gnuplot commands that produces a label with an underscript _{1} and the Ω symbol {/Symbol W} preceded by a small space &{.}, which
show correctly in the wxt window
show correctly on a SVG file exported from the wxt window
shows no underscript and .W if plotted to the SVG terminal
Here's a snippet of the code:
set label 3 "R_{1} 100&{.}{/Symbol W}"
set terminal svg size 1024,768 dynamic font 'Lohit' fsize 14 enhanced background 'white'
set output 'svg-file.svg'
plot ...
set terminal wxt 0 font 'Lohit,14' enhanced
set output
plot ...
I set both terminal to enhanced mode. What am I missing?
It's probably better these days to input Unicode directly, rather than using the Symbol font. Ω!
The output of your example with gnuplot's svg terminal contains the label as
<tspan font-family="Symbol" >W</tspan>
which leaves it to the viewer/browser to display it correctly. Your example works fine for me with Chrome/Edge, but not with Firefox.
The output of the wxt-svg-export doesn't contain text like show above, but the text is converted to paths in order to avoid such platform and viewer dependency (but has other drawbacks)

Not the same font in gnuplot when using command line or gnuplot commands

I have a file containing some commands :
$ cat components.plg
set terminal png
set output output
set font "Helvetica,10"
unset xtics
unset ytics
unset border
plot "reportGraph_0" with lines title "Component 0", "reportGraph_1" with lines title "Component 1", "aoi.txt" with lines title "Area of interest"
$
I won't display the contents of reportGraph_# here, but anything with 2 points in them is valid.
I then launch gnuplot with this file as parameter, and I get a warning about Arial (I'm not entirely sure why).
$ gnuplot -e "output='footprint.png' " components.plg
Could not find/open font when opening font "arial", using internal non-scalable font
$
However, the result image has its text in non-Helvetica (but more in something like Monospace sans).
Here are the two images (first the output of the command line, second the output of the same sequence of commands launched in a gnuplot shell, and exporting the result image). There is one difference, I didn't use the first two commands (set terminal png and set output output) in gnuplot - I merely "exported" the image as png.
The question is : why don't I have the same font in these two images?
I would like to have Helvetica (or Lucida Grande, but not a monospace font).
Gnuplot has a large variety of terminals. When you launch an interactive gnuplot session and plot you probably use the wxt or qt terminal. By exporting the image from the plot window you save the image as theyes were created by those terminals.
Now, with set terminal png you use a different and quite old terminal, with different capabilities, especially regarding font rendering.
If you want to save your image directly as png, use the pngcairoterminal, which produces higher quality images (the result should be equivalent to that of the exported image from wxt).
The pngcairo, or the pdfcairo terminals should also handle your fonts properly.
The png terminal is older than pngcairo, but it can still use a specified font. You can just specify a path to a .ttf or .pfa font file:
set terminal png font "/path/to/your/Helvetica.pfa"
or a comma-separated pair of the font file path and point size:
set terminal png font '/usr/share/fonts/liberation/LiberationSans-Regular.ttf,9'
gnuplot uses libgd so if you set the environment variable GDFONTPATH to the directory containing your .ttf or .pfa font files, you can specify just the font name instead of the full path:
set terminal png font 'LiberationSans-Regular'
Documentation for setting fonts with different terminals is available within gnuplot under help fonts gd, help fonts cairo, and help fonts postscript.

Gnuplot: linetype Version 5.0 patchlevel 3

I am using gnuplot 5.9 patchlevel 3 and I wanted to use different lt thus I wanted to reproduce the following this tutorial from gnuplot 5.0 patchlevel 1.
In particular if I copy it and launch it both from term and as .eps I couldn't see dashed lines, here the output
In particular I do not understand the following line:
You will only see dashed lines if your current terminal setting permits it
What does it mean? How I can 'force' gnuplot to print the different dashed lines in .eps, .png or via screen?
I found this guide but its refer to a 4.2.5 version of gnuplot, even if I use:
set termoption dashed
or
set terminal x11 dashed
I can't see the dashed lines...Those are the terminals I can use in gnuplot 5.0 patchlevel 3 from help term:
canvas cgm context corel
dumb dxf eepic emf
emtex epslatex fig hpgl
latex mf mp pcl5
pop postscript pslatex pstex
pstricks push qms svg
tek40xx tek410x texdraw tgif
tkcanvas tpic vttek x11
xlib xterm
I red also this answer but gnuplot 5.0 doesn't support pngcairo (???) as a test, in fact, I just try:
set term pngcairo dashed
And I receive the answer:
Terminal type set to 'unknown'
^
unknown or ambiguous terminal type; type just 'set terminal' for a list
Thus I tried to install pngciaro following this page using homebrew which I found not so useful unfortunately due to the fact that the question about gnuplot 5.0 does not have an answer and because I receive some warning that could be connected with the installation of the pngcairo.
I am using gnuplot 5.9 patchlevel 3
Surely you mean 5.0.3? The image you attached shows dashed lines so what's your question? Then I tried this example script you link to with the eps terminal and it works fine as well on 5.0.3.
Gnuplot renders output using different "terminals", some of the more terminals do not support support dashed lines and this includes the default PNG terminal png, the png terminal from the cairo library, pngcairo, does however support dashed lines. Terminals must be integrated into your Gnuplot build at compile-time, so options must be flagged to enable certain terminals. If Gnuplot was not built with the cairo library then the pngcairo or epscairo terminals will not be available and you will receive that message
unknown or ambiguous terminal type; type just 'set terminal' for a list
when attempting to set you plot to one of those terminals. When you do set term it just displays the terminals which your build was compiled with.
Gnuplot 5 does support pngcairo, it just has to be built with it. Are you on OSX and have homebrew installed? Just install it with cairo support using
brew install gnuplot --with-cairo

Gnuplot Postscript Special Characters Math Equation

I`d like to write the math stuff into a plot using gnuplot 5:
I am using the terminal postscript enhanced because as far as I know this terminal is the only only capable of doing such things.
I used this code:
set label 1 at 400,200 '{/Symbol=50\362#_{/=15 350}^{/=15\154}}' front
This gets me everything except the subscribed averageunder the lambda symbol.
I tried everything with {,}and so on but I think I missing the part where I can escape the /SymbolStyle.
Many terminals support enhanced text, not only the postscript terminal.
In order to use another font than /Symbol for the subscript you could change the font explicitely to a different one for this. However, a better approach is to change the nesting so that /Symbol affects only two parts:
set label 1 at 0,0 '{/=50{/Symbol \362}#_{/=15 350}^{/=15{/Symbol \154}_{/=10 average}}' front
plot x
Output with gnuplot 5.0 with wxt is
If you're using the postscript terminal anyway, you could give a try to the epslatex terminal (or cairolatex):
set terminal epslatex standalone color colortext
set output 'equation.tex'
set label 1 at -5,5 '$\displaystyle\int_{350}^{\lambda_{\mathrm{average}}}$'
plot x
set output
system('latex equation.tex')
system('dvips equation.dvi')
system('ps2pdf equation.ps')

Resources