cmyk rgb gnuplot and prologues - gnuplot

For a publication I am required to convert all my nice little GnuPlot (and PowerPoint) pictures from RGB to CMYK. In theory it does not seem so complicated but apparently no non-commercial programme is able to solve it.
I am using GnuPlot for my figures. Is there a simple command to convert my rgb files to cmyk? I have read a lot about "editing the prologue file". I found this file, however I have no clue what to do and where and on the interwebz nobody asked further after asking this question...
I am outputting with the following terminal:
set terminal postscript enhanced color solid linewidth 1 font "Helvetica" 11
I have spent a good couple of hours searching for a solution for this problem and apparently it is either very difficult to impossible or so easy that nobody clears up anything after solving it. I did not find any solutions so far, hope you guys can help me!

You can try the ps2write device in Ghostscript. It won't 'convert' your files to CMYK, but it will create a new PostScript file which should be visually the same as the original, and can include colour conversion as part of the process.
Note that ps2write only supports language level 2, so any level 3 constructs will be rendered to images, which may well be undesirable.

Related

Produce old style graphs and diagrams with gnuplot?

Hello fellow Stackoverflowers:
I am curious if it is possible to create a style or control the aestetic of the graphs and diagrams to look like they are from a turn-de-siclé book (talking about the 19th-20th centuries), that is, imitate the look of an etched graph. I have a simple diagram that I produced on inkscape that is a very very crude aproximation to what I am looking.
Could I produce something more "metal/wood engraving" on gnuplot? I have gnuplot 5.0.5. Thank for your attention, I hope this is the right forum.
Use gnuplot command test to see what fill patterns available.
Modifying or adding custom fill pattern is extremely difficult in gnuplot, as far as I know. See this example for how to manipulate the fill pattern: Gnuplot: how to fill a bar with both a color background and a pattern

gnuplot gif not scalable with ttf font

After installing libgd on RedHat Linux, I found the path to .ttf fonts and used the full pathname to a DejaVu .ttf font (in 'set terminal gif font...") to create a .gif file from gnuplot. It looks good in a Firefox window, but when I change the size, it looks bad, as though the font is not scalable.
I am using the default binaries. Do I need to recompile gnuplot with different settings to make it scalable? I get no errors or msgs when the image is created from gnuplot (i.e. it finds and uses the .ttf file; I know because I tried several fonts and the image responded accordingly, with .pfa fonts also).
The gnuplot documentation says that TrueType fonts are fully scalable. Maybe I don't understand what scalable means. I had a similar problem with SUN OS, and my solution was to create a postscript (.eps) file from gnuplot and then convert it to .gif, and then it was scalable, but I don't have such a conversion utility on Linux (yet), and it seems like an unnecessary step.
I don't have the actual code/output in front of me, but I can add some if it would help. Also, I can't find any arial.ttf fonts on the system. Maybe that is a clue to the problem.
I heard good things about pngcairo (to avoid using gd), but 'set terminal' does not list it as an image type.
This is not a definitive answer, but it allows to show me a picture of the situation on my machine.
This plot was generated as gif using gnuplot 4.6p5 and Suse Linux 13.2.
The upper plot shows labels written in DejaVu, left using the full path to the TTF file, right using the name of the font. (DejaVu is an installed font here.)
The lower plot shows the same, the font is from the game Minecraft (i.e. very pixelated). I do not get any error message about missing fonts or similar, but gnuplot uses its default font here, but not what I want. More interesting: When I do not specify the font, I get Liberation Serif...
However, it seems my system ONLY uses fonts, regardless if referenced by name or path, when the font is correctly installed. Nevertheless, also the default font is smooth and scalable. (the gnuplot help says, gd has some not scalable build-in fonts, which may be used in your plot)

output.png from gnuplot is not as good as the figure from prompt shell

I often plot graphs in gnuplot prompt shell, like this:
gunuplot> plot sin(x) with linespoints pointtype 3
and the figure showed up is great.
Today, I save the graph in a .png file, like this:
gnuplot> set term png
gnuplot> set output "output.png"
gunuplot> plot sin(x) with linespoints pointtype 3
Then, I open output.png with eog in Ubuntu, like this:
$ eog output.png
I found that, the output.png displayed in eog is not as good as the figure plotted in prompt shell.
Why is that? Do I need to adjust some settings before save the output.png?
PS
I found that a way around it, first,
set term postscript
set output "output.ps"
then in linux shell,
$ convert output.ps output.jpg
This way some sort of solve the my problem.
The source of your problems with the PNG quality is most likely the missing antialiasing in the png terminal of Gnuplot. Since you give no screenshots, I'm not sure what you mean when talking about bad linewidth, but here's how it looks for me (on MacOS). This screenshot shows the output of gnuplot's native aquaterm output:
If we create a png using set term png, the lines become "jumpy" and pixellated:
However, there is a version of the png terminal that uses the Cairo libs for rendering, and that makes the output far more smooth and nicer. set term pngcairo gives this result:
You can use set terminal to check whether this terminal version is available for you. If it is, this should save you conversion work and also give better image quality than a JPG (which is not an ideal format for line art).
The default size of the PNG image generated gnuplot with the PNG terminal is 640x480 pixels. This resolution in certain cases may result in "pixelated" graphs which are not as nice as those produced on screen with the default (wxt) terminal.
You can change the resolution of the output image using the size option:
set terminal png size <x,y>
where x and y are the desired numbers of pixels along the horizontal and vertical axis, respectively.
For example:
set terminal png size 1024,768
Please note that, images with larger resolution will result in proportionally larger files on disk. Alternatively you can try to use non-raster terminals like "post eps" or "pdf" if available on your machine, which may give you high quality scalable and (relatively) portable images without a large disk footprint.
Alternatively, if you want professional (publication-ready) quality images with gnuplot, you should have a look at the epslatex terminal. I have used it extensively for my thesis and my papers with very nice results, virtually no pixelation problems, portability when converting images to pdf, and almost all the capabilities of Latex.

How can I make a custom layout / change header background color … with Tex, Latex, ConTeXt?

currently I produce dynamically this document with Python Report Labs… to produce pdf documents.
Now, I would like try to produce this document with Tex / Latex / ConTeXt…
I've some questions :
how can I make the layout ?
how can I make header background color ?
how can I define my custom title (with blue box) ?
what is the better choice for my project : Latex or ConTeXt ?
What package I need to use ?
geometry ?
fancyhdr ?
Have you some example ? some resource ?
Yesterday, I've read many many documentation… and I don't found a solution / example for my questions.
Some useful packages apart from the fancyhdr you already mentioned are:
titlesec for more control over your section titles
booktabs for more control over table layout
PGF/TikZ for the graphics in your document, i.e., the page turn effect in the corner and maybe the blue boxes (although that might be considered a bit overkill :))
memoir for more control over your document layout, but the package is more book-oriented than you need probably
koma-script might be a good alternative for memoir but I'm not familiar with it so I don't know about its weaknesses
This is list is not exhaustive and I am not experienced enough in this kind of typesetting meets lay-out stuff to be of much help, but these are packages that come to my mind given your problem :).
Using inputenc there shouldn't be a problem typesetting Russian text.
Maybe the actual process will be easier in ConTeXt, it is more oriented towards control over your typesetting but I'm not familiar with it.
Good luck!
I'd certainly do this kind of think in Context rather than Latex: Context permits grid layout, and allows you to define layers for putting text and other graphics on top of background graphics. But as Pieter says, you could try using TikZ to do this with Latex.
Unicode is no barrier to regular Latex or Context: with either, just specify that you want to use utf-8 as input encoding.
If you do use Latex, don't have headers or footers, and allocate no vertical space for them either.
With Context:
how can I make the layout? — Use grid layout.
how can I make header background color? — Use \setupbackground
how can I define my custom title (with blue box) ? — I don't understand what you want to do here.
Everything you need to do this, except grid mode and how to put graphics in the background, is documented in Context an excursion. Grid mode is explained in the Context manual. Layers are a bit tricky to get to grips with, but Layers in the Context wiki is a good place to start.
With titlesec and color packages use this in LaTeX head (before \begin{document})
\usepackage{titlesec}
\usepackage{color}
% Colors
\definecolor{textcolor}{rgb}{.90,.95,1}
\definecolor{boxcolor}{rgb}{.94,.97,1}
% Header style
\titleformat{\section}
{\color{textcolor}\normalfont\Large\bfseries}
{}{1em}{{\color{boxcolor}\rule{0.35cm}{0.35cm}}\quad}
to make the blue box and change header color, font and remove numbering.

Does anyone know a light Vim scheme which makes coding more readable and pleasant?

I know a lot of nice dark schemes for Vim which makes coding more readable and pleasant such as ir_black, wombat, zenburn. Its weird but I haven't seen so many popular light themes (white background).
Does anyone knows a light Vim scheme which makes code more readable and pleasant to see?
(that makes code less confusing to distinguish, something like Visual studio's default scheme?)
With all due bias-based disclaimers and caveats (I am the author of the color scheme), I find that Mayan Smoke both highly ergonomic as well as aesthetically pleasing (screenshot). Download page: http://www.vim.org/scripts/script.php?script_id=3065.
As alternative, you should also have a look at the immensely popular Pyte, which is eerily similar to Mayan Smoke (development was independent, and the similarity is convergence, I swear!), though the syntax colors are a lot more muted.
Check out http://vimcolorschemetest.googlecode.com/svn/html/index-c.html, it has a HUGE list of colorschemes with previews.
If you do not like C samples, there are samples with other programming languages, too: http://code.google.com/p/vimcolorschemetest/
Louver is a bare-bones, light color scheme that somewhat resembles the default Visual Studio look.
Screenshot:
http://jstap.web.fc2.com/louver.html
I like Solarized for LCD monitors. It sucks on CRTs.
http://www.vim.org/scripts/script.php?script_id=3520
Screenshots at http://ethanschoonover.com/solarized
This new theme is really nice, even with GVim on Windows:
https://github.com/reedes/vim-colors-pencil
I like dark background, but changing software a lot which like IE, VS studio .... So changing from dark to light and back is so uncomfortable, so light background is also my choice, I more prefer the theme name ironman, you can find it on vim plugin page.
You should try eclipse theme.
https://github.com/vim-scripts/eclipse.vim
Interesting subject and such contradictory statements. First: according to my experience, everything with dark background is very bad for my eyes, unless I work in total darkness. But you shouldn't work in darkness anyway, just turn the lamp on.
Second: for (my) eyes feels best the backround color which I would describe "light neutral gray with slight greenish tone". BUT: especially these colors are very different from one monitor to another (with same RGB value), for example these are "guibg" colors from my two computers' schemes: guibg = #E2E2D8 on one pc and guibg = #E6EDD8 on another. Despite the colors look very similar they have different values. So honestly, there is only one way to make it "good for your eyes" - just pick some good scheme and finetune the colors, especially this background color is important imho. Also you can set several schemes with bg color adopted to outer lighting conditions. So if you see a description like "this color scheme is very good for eyes", it's sort of bulls*it, since it really depends. But I'd certainly advise to avoid any dark schemes.
As for me, readability is high and uniform contrast of all syntax elements.
https://github.com/andbar-ru/vim-unicon

Resources