Why is line solid? - gnuplot

I type in gnuplot "plot cos(x) lt 2" and want to take dashed line, but I take only solid line.
I use gnuplot 4.2 and ubuntu 10.04

It depends on the Terminal being used via
set term TYPE_OF_TERMINAL OPTIONS
Some Terminals are unable to display dashed lines.
You would see Terminal being set at the start: Terminal type set to 'TYPE_OF_TERMINAL'
example for ps/eps : set term postscript eps enhanced
At least this way you can include it in your TeX documents.

Related

color schemes interaction in terminal, zsh, and vim

I noticed that the color-scheme setting in .zshrc does not affect the background color of the terminal window, so I decided to load a separate preset color-scheme for the OSX terminal. This, in return, changed how the .zshrc color-scheme looked previously. Vim also has its own color-scheme that seems to be affected by that of the OSX terminal.
I'm curious if there is any universal method to change the color-schemes of all three parties. If not, please help me understand the interactions of color-schemes in the OSX terminal, vim, and zsh
Terminal
Terminal.app lets you change its default color palette in its preferences. Those colors are referenced by your shell and the programs you run in it either with standard names like "blue" or with numbers from 0 to 15. Changing your terminal emulator's palette will obviously change the look of your shell and the programs you run in it.
ZSH
Some zsh themes use color numbers (16-255) from the xterm palette. It is possible to alter that palette but that practice is not common and I've not heard of a zsh theme doing that (which doesn't mean it doesn't exist in the wild) so it is relatively safe to assume that those colors will be the same across terminals. Such themes should not be affected by your changes to the terminal emulator's default ANSI palette.
Some zsh themes, on the other hand, use standard color names like "green" or "red" which correspond to the 16 ANSI colors defined in the preferences of your terminal emulator. Since you changed those colors, it is logical to expect that your zsh theme looks different.
Vim
Well written Vim colorschemes are usually capable to work in an 8/16 colors environment or a 256 colors environment. What set of color codes to use is determined by Vim from your terminal emulator's TERM:
TERM colors
xterm 8
screen 8
xterm-256color 256
screen-256color 256
Using a 256 colors ready colorscheme in an 8/16 colors environment won't work because only the numbers 0 to 15 will be used correctly.
Using a 256 colors ready colorscheme in a 256 colors environment will likely give a consistant experience and be immune to changes in the default ANSI palette.
Using an 8 colors ready colorscheme will likely have the same effect whether you use a 256 colors environment or an 8/16 one. Such colorschemes depend completely on the default ANSI colors, though, so they will look differently if you change your terminal emulator's settings.
Conclusion?
Given the following:
your zsh theme only uses standard ANSI names,
your TERM is set to an 8/16 colors value,
your Vim colorscheme is 8/16 colors ready,
you should be able to achieve a consistant look and feel across the board only by tweaking the ANSI color palette in Terminal.app's preferences.

How to produce dashed lines in gnuplot 5 using TikZ terminal?

I have recently upgraded to gnuplot 5 and have been unable to produce dashed lines using the TikZ terminal. Running these commands:
set term tikz
set output "test.tex"
test
produce dashed line types in gnuplot 4.6 (first image), but only solid ones in gnuplot 5 (second image). Is there a way to fix this without downgrading?
I have tried setting different values for the dashlength terminal option, but that didn't help.
With 5.0 gnuplot has changed its way to deal with dashed lines. All line types are solid by default, this is what the test command shows you.
To enable dashed lines, use the new dashtype keyword, e.g
plot for [i=1:4] i*x dashtype i
That works for all terminals which support dashed lines.
Note, that with dashtype you can also specify your own dash patterns.
Example script:
set terminal lua tikz linewidth 3 standalone
set output 'dash.tex'
unset key
set linetype 1 dashtype 2
set linetype 2 dashtype '..-'
set linetype 3 dashtype (2,2,4,4,6,6)
plot for [i=1:3] i*x

How/where are RGB values mapped to xterm color codes? Can they be overridden?

I'm trying to understand exactly how colors are processed in my terminal emulator (iTerm2).
In iTerm2 I can configure my "base 16" color palette - in iTerm2 this is done using HSL, not 16-bit RGB values. The colors defined this way are native - they use the cocoa API and are not limited to the typical 256 color palette (they are rendered in true color).
X11'srgb.txt defines names for the colors in the 256 color palette.
In a shell, bash or zsh, I can print text using the 16bit 256 color palette with echo -e "\e[38;5;82mHello \e[38;5;198mWorld" (the third parameter is the xterm color code)
In vim (terminal not gui) the colors are utilized as a 'cterm' value when defining highlights (for example: :highlight Normal ctermfg=188 ctermbg=233 guifg=#e8e8d3 guibg=#151515), however as far as I can tell - there is no way to define a terminal color using an RGB code, so while I can display the base16 colors in truecolor, the rest of the colors are arbitrarily limited to the 256 color palette.
What I haven't been able to figure out is where rgb values are mapped to the xterm codes. It appears to be an arbitrary relationship (the xterm codes don't appear to have a functional relationship with the RGB values), so I assume there must be a mapping somewhere.
I believe that the colors can be redefined in .Xresources (here is an example), but I'm unsure about a couple things:
.Xresources is specific to the xterm terminal emulator, and I'm using iTerm2, so (I believe) that this is irrelevant in my case. I've mucked around and iTerm2 doesn't seem to respect the .Xresources configuration. I was unable to find more documentation on this subject.
I've read that xterm will approximate color definitions from .Xresources that are outside of the web-safe palette - I'm not sure if this is true or exactly how it's done, but I imagine that this is a historical limitation associated with the amount of bits being used to store the colors.
So at this point I believe way it works is:
Terminal applications emit the xterm-compatible escape code sequence - and colors are always defined as an xterm color code (0-255).
iTerm2 detects the escape sequence.
iTerm2 uses an internal mapping that respects X11's rgb.txt to map the xterm color code to an HSL value.
iTerm2 renders color using the cocoa API.
So, no other applications (X11 or anything else) are involved in the color mapping or conversion - it's straight from the terminal application to the terminal emulator.
This being the case, since iTerm2 only allows user to configure the "base 16 colors" users are free to use true color when rendering those only, but restricted to the web-safe palette for all other colors.
Is this correct?
The default xterm palette is standard and expected to be the same in every xterm implementation. It is different from the more or less standard rgb.txt that is only used by GUI programs.
The first 16 colors, 0-15, have more or less standard names, "red", "darkgreen", etc. but all the others can only be referred to by their number, from 16 to 255.
The first 16 colors can usually be defined by the user (using CMYK, HSL, RGB or hexadecimal notation, it doesn't matter) so using "red" or "2" in a colorscheme is pretty much a shot in the dark as there's no guarantee whatsoever that "red" will actually be red. Solarized is an horrible example where the color traditionally referred to as "bright green" is actually a dark grey.
Most "modern" terminal emulators let you define those 16 colors with a GUI but other more "old school" emulators like xterm or rxvt use ~/.Xresources. That file is completely ignored by iTerm so you shouldn't waste your time on it.
It is possible to change the xterm palette but few people know about that which makes this practice very uncommon.
So…
terminal emulators don't use rgb.txt,
colors 0-15 are user-configurable,
colors 16-255 are restricted to the color chart in the first link,
colors 16-255 can be changed but it is rare,
iTerm doesn't use .Xresources.

How to color arrows using the epslatex terminal and 'with vectors'

I know from Gnuplot coloring 3D-vectors how one is supposed to color arrows. However, under Windows Gnuplot 4.6 Patchlevel 5 the following MWE does not produce red arrows but simply black ones.
reset
set terminal epslatex size 15cm,9.27cm color colortext 8 dashed
set style arrow 1 linecolor rgb "red"
file = 'OutputSetting0'
set output 'Setting0/test.tex'
set xrange [-1:1]
set yrange [-1:1]
set zrange [-1:1]
set arrow 1 from -1,0,0 to 1,0,0 arrowstyle 1
splot file u (0):(0):(0):2:3:4 with vectors arrowstyle 1
reset
exit
The extra arrow added by hand (set arrow ...) is colored red. However, the one with position data read from file is still black.
Is there another way how one could achieve colored arrows from file (except changing the terminal which is out of the question)?
As requested here is also a MWE of LaTeX code:
\documentclass{scrreprt}
\usepackage{color}
\usepackage{graphicx}
\usepackage{epstopdf}
\begin{document}
\begin{figure}[H]
\input{Setting0/test}
\end{figure}
\end{document}
Ok, it seems to be a bug?
Adding set hidden3d made my arrows go red. I promise I didn't touch any other part of my script.

Is there anyway to set the window position for TERM WXT?

There is no SET TERM POSITION option in gnuplot.
I am using cygwin on windows 7.
Is there some kind of work-around?
Gnuplot version 5.0 knows a position option for the interactive terminals:
set terminal wxt 0 position 0,0
plot x
set terminal wxt 1 position 200,200
plot x**2

Resources