Gnuplot: linetype Version 5.0 patchlevel 3 - svg

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

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

Gnuplot: gif unknown terminal

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

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')

how to rotate 3D image in gnuplot

Do we have a facility to rotate the image, using mouse, to see different views in gnuplot.
I wish gnuplot had similar facility to rotate the image as MATLAB has.
In my version it just works.
Version 4.4 patchlevel 0
last modified March 2010
You might need to change the terminal for gnuplot.
The window with the nice toolbar is generated by the "wxt" terminal.
gnuplot> set term wxt
Use 'set term' without parameters to show a list of available terminals.
gnuplot> set term

How do I access various true type fonts through gnuplot with png terminal?

I am trying to output a png image with an arial size 14 font. I use mac OS X 10.6 and did not build GNUPLOT myself. I got the program from a website called High Performance Computing for OS X in the package for Octave. Here is what I entered in gnuplot:
G N U P L O T
Version 4.2 patchlevel 5
last modified Mar 2009
System: Darwin 10.0.0
Copyright (C) 1986 - 1993, 1998, 2004, 2007 - 2009
Thomas Williams, Colin Kelley and many others
Type `help` to access the on-line reference manual.
The gnuplot FAQ is available from http://www.gnuplot.info/faq/
Send bug reports and suggestions to <http://sourceforge.net/projects/gnuplot>
Terminal type set to 'x11'
gnuplot> set term png font "arial" 14
Terminal type set to 'png'
No TTF font support, using internal non-scalable font
^
invalid color spec, must be xRRGGBB
gnuplot>
Any help would be greatly appreciated. Thanks!
The following works on Mac OS X 10.5 with gnuplot installed via MacPorts:
set terminal png font "/Library/Fonts/Arial.ttf" 14
The documentation is available via help terminal png (emphasis mine):
If gnuplot was built with support for TrueType (.ttf) or Adobe Type 1
(.pfa) fonts, they may be selected using the 'font {}'
option. is either the full pathname to the font file, or a font
face name that is assumed to be the first part of a filename in one of the
directories listed in the GDFONTPATH environmental variable. That is,
'set term png font "Face"' will look for a font file named either
/Face.ttf or /Face.pfa. Both TrueType and
Adobe Type 1 fonts are fully scalable and may be rotated through any angle.
If no font is specified, gnuplot checks the environmental variable
GNUPLOT_DEFAULT_GDFONT to see if there is a preferred default font.
Update: I just noticed that your gnuplot installation complains about "No TTF font support", so the above may not work for you. In order to get true type fonts to work at all, you probably have to re-install gnuplot.
Thanks! The info with $GDFONTPATH was really helpful for on MacOS.
Adding the line:
export GDFONTPATH=/System/Library/Fonts:$GDFONTPATH
to my /Users/username/.profile solved the Problem for me. Don't forget to source the .profilefile. Or to restart the Terminal. So that the variable gets loaded.
It depends on the terminal type
On (X)Ubuntu LTS GNU/Linux, gnuplot seems to look up fonts in a whole host of directories by default. For example, the following line worked by default with the terminal png:
set terminal png font "texgyrepagella-regular.otf" 12
Even though I had no environment variables set and the package manager had previously installed this font in /usr/share/texmf/fonts/opentype/public/tex-gyre. Nice!
However, if I employ the more advanced terminal pngcairo, the very same font is specified by its name; not its filename. Even nicer!
set terminal pngcairo font "TeX Gyre Pagella, 12"
Please, also notice the syntactic difference in specifying the font size.

Resources