Produce old style graphs and diagrams with gnuplot? - graphics

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

Related

How to merge multiple colors and objects of different sizes into an image in Inkscape

Hi Inkscape learners and professionals,
I am learning Inkscape. I am trying to merge multiple colors or ornaments of different shapes, sizes, and colors into an object/picture. I want to see my final image with no colors or any objects beyond the boundaries of my image. Is there any specific tool I can use in Inkscape or tutorials on this to watch? Please see an example here.
Let’s say, I have this vector file:
And I want the final image to look like this:
Any advice and suggestions would be appreciated. Thank you.
As mentioned above by #Juancho, you must learn Masking and clipping which is mostly used in all graphic design softwares.
Your problem can be resolved by simple clipping (Inkscape -> Object -> Clip ->set). Check it out:
https://imgur.com/Taftj2Y

Italicize and color legend manually for different graphs using same labels and colors

I am trying to create multiple graphs that share the same legend.
I have found many ways to combine multiple graphs and it seems that ggarrange has the ability to create one shared legend for all that is supposed to be unique.
However I am having some problems when graphing since a few of the graphs do not have the same phyla (what defines the legend colors) present, but I would like them all to be the same colors throughout all of the graphs so the combined legend will have the correct colors.
For just one graph I would assign a color to the label manually like below
labs<-c("Arthropoda"="#FF66CC"
,"Cercozoa"="#FF6000")
and plot with the addition of scale_fill_manual(values=labs) and this seems to work
then I modified it so I could have portions of them italicized.
labsPhylum <-c('expression(paste(italic("Arthropoda")))'="#CC0000"
,'expression(paste(italic("Cercozoa")))'= "#FF6000"
,'expression (paste("unknown", ~italic("Eukaryota")))'= "#990000")`
However when I create a plot using ggplot and scale_color_manual() using the labsPhylum that I think should be italicized and colored I plot an empty graph with this warning so there is something vital I am not understanding here.
ggplot(data=sigtab_dil, aes(x=Species, y=log2FoldChange, color=Phylum))+
geom_point(size=2) +
scale_color_manual(values=labsPhylum)
Warning message:
Removed 9 rows containing missing values (geom_point).
Could someone please help me figure out where I am going wrong?
Thank you
Answered my own question
I realized I had to make separate vectors for breaks, labels, and values rather than combining them.
In short
colsPhylum <-c("Arthropoda"="#CC0000"
,"Cercozoa"= "#FF6000"
,"Chlorophyta"= "#CC9900"
labsPhylum <-c(expression(paste(italic("Arthropoda")))
,expression(paste(italic("Cercozoa")))
,expression(paste(italic("Chlorophyta ")))
breaksPhylum <-c("Arthropoda", "Cercozoa","Chlorophyta", "Choanozoa"
,"Ciliophora"
,"Cryptista"

cmyk rgb gnuplot and prologues

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.

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.

Alternatives to using text() to adding text to a plot

This may be a naive question, but I was wondering if there's a better way than using text() to adding text to a plot. Note, I'm also using layout() as well. Specifically, I have a section of a plot where I would like to add some text with headings followed by regular text.
text() is fine it seems for simple annotations, but to get the spacing right for several lines of text seems to require a lot of manual manipulation of the x and y and cex parameters. Any suggestions?
Here are some alternative options to consider:
- the gplots package has a textplot function to add some text output in a base graphics plot.
- plotrix has a function addtable2plot
- for grid graphics grid.text() is available and in gridExtra there is a function grid.table() (see, e.g., R-Wiki)
If you're using base graphics, then text() is probably your best bet, and fiddling with coordinates etc is part of the game. If you want to learn a new framework, the lattice package is a reworking of the basic approach to plotting in R. It be installed by default so help(package='lattice') will get you started.
Here's a pretty good guide (pdf) to graphics in general in R, with a substantial section on lattice:
download

Resources