Is there a way to set the default size of a plot window? - linux

I would like to change the default size of an R plot window. Does anyone know if there is a configuration setting for this?

Your default size of a plotting window can be set using windows.options() or X11.options() with the width and height parameters. I think setting the defaults using windows.options() also sets them for X11 devices, at least on my windows machine. On Linux, X11 is used as a graphics device and thus you should be able to use X11.options() for your needs. If you want to save these defaults across R sessions, in the examples of http://stat.ethz.ch/R-manual/R-patched/library/grDevices/html/x11.html you can find a way this can be done.

If you want to set the size of the plot window to 600x600, say, add this line to ~/.Xresources:
R_x11*geometry: 600x600
and reload the file with
$ xrdb -merge ~/.Xresources

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

what is the difference between cterm color and gui color?

I am customizing my own color scheme for Vim but I don't know when should I configure ctermfg/ctermbg variable and guifg/guibg variable because I didn't see any differences between them at all. Is there any difference between them?
Can any one give me an illustrative example of how to use them ?
Thanks
I didn't see any differences between them at all
ctermxx is used by console version of Vim (when set notermguicolors). guixx is used in GVim, or in console if set termguicolors, and the console is capable of TrueColor, obviously. Hence you must test it in different programs to see the difference.
Also, some colors could be the same or very close to each other, e.g. "blue" is "blue" both in GUI and console.
Can any one give me an illustrative example of how to use them?
hi Normal guifg=#1034a6 guibg=#f5f5dc ctermfg=19 ctermbg=230
Should look very similar but still a little different in GUI and console
For symbolic colors names see :h cterm-colors and $VIMRUNTIME/rgb.txt. The cheat sheet of 256 color indexes for console is available here.
The separate pairs allow you to specify different colors for a terminal (which may limit you to a fixed-sized palette of colors, usually 16 or 256) and a GUI (which typically provides a much larger palette or even direct access to any color your display can handle).
For example, if you start a session in your terminal using vi some_file.txt, then ctermfg and ctermbg would be used. If you start an instance of gvim (which opens its own window independent of your terminal emulator), then guifg and guibg are used instead.

Using gnuplot with a hidpi screen.

I am using gnuplot on a hidpi screen (276 dpi).
The plots I recover are hard to see properly, the lines too thin, the fonts and buttons too small.
Is there any way to configure gnuplot to scale up these parameters for hidpi screens automatically upon start?
gnuplot automatically loads an initialisation file on startup, that you can use to change the default linewidths etc. It accepts normal gnuplot syntax. Check help initialization to see how it's named and where to place it on your system.
Use e.g. set terminal wxt lw 2 to change the absolute default linewidth. The sizes given in a later plot command are just multiplicators for the terminal setting. The pointsize and border/tics linewidth are scaled accordingly.

Gnuplot script disappear after creation

I have a gnuplot script. My system is ubuntu 14.04. When In the terminal I type gnuplot myPlot. The plot will disappear. It is not remain on the screen. I this stack in saw similar question. But its system is windows. I want to know is there any solution for that on ubuntu 14.04 32 bit
PS: when I use gnuplot>-- I mean when I do not use script file-- I see the diagram and it does not disappear.
PS2 : this is my simple gnuplot script file :
set boxwidth 0.5
set style fill solid
plot "dataFile" using 1:2:xtic(2) with boxes
If you want the plotting window to remain open, you must call gnuplot with the -persist flag:
gnuplot -persist myPlot
There are already nice answers here, but the -persist flag did not work for me and enabling x11 force GnuPlot to use crapy XQuarts for windowing instead of beloved Qt. What worked for me was the
pause -1
command (from here) at the end of the script. According to the documentation
pause -1 # Wait until a carriage return is hit
I hope it helps.
If you do not want to call gnuplot with the extra argument (-persist), you can enable this functionality within your script, e.g.
set term x11 persist

How increase the size of the legend in Gnulot

Can someone please direct me as how to increase the size of a legend in Gnuplot.
I wish to place the legend outside with:
set key outside top
But now I want the legend to appear larger in size. How can this be done?
The font specification can follow the setting of key, from help key:
{font "<face>,<size>"}
You do not need to specify the face if you only want to change the size, e.g. to set font size to 16 do this:
echo 'set key outside top font ",16"; plot sin(x) w l' | gnuplot --persist
Which fonts are available depends on the terminal setting, e.g. if your terminal is wxt, you can find out more by running help wxt, etc.

Resources