Heat map with opacity gradient - r

I have two heat maps that I want to overlay to create one combined map. I am looking for a way to make an opacity/alpha gradient instead of a color gradient; that is, transparent->blue instead of white->blue.
I have access to a lot of plotting software (R, mathematica, gnuplot, grace, excel, etc) but I just don't know what program is capable of this kind of gradient.
So far, the best that I can do is make two heat maps in excel, then make one slightly transparent and overlay it on the other. The problem is, this muddles the colors so that the dark shades are no longer dark. This figure can be found here: Excel Heat map overlays
Thank you in advance for any help!
Scott

Related

Color visualization for different parts of a diagram

I have some gene expression data in different parts of plant roots (see the image) and I want to show the gene expression levels in different parts of the roots. For example, if the gene is highly expressed in the apical meristem, I want to mark the apical meristem part of the schematic diagram red. One possibility is to make the diagram a map, does anyone have any suggestion how to make a diagram to a map in R? Or if you know any tool for this purpose, please let me know. Thank you!
The plant root structure
You could draw your own polygons to separate the regions using the raster package. Or, this post may provide a better way to do this.
Then, you can create a heat map and color within the polygons. Say, with ggplot2::geom_polygon()
To make it look even better, you could use the original image as a background, and then overlay your heat map with some transparency (i.e. the alpha argument in ggplot2) so you can see the colored heat map and some of the original image. See this post for more details, or this post if you like funny pictures

Recreate graph gradient colors in R

I'm looking to create very high quality data visualization in R and I'm not sure how to create some of the gradient colors in the in the bar graph below (full link here).
I believe ggplot can do some gradient fills, but in this case, i'd need a stacked color and background color, both of a light grey-to-orange gradient. I can't find a command to do that. The column widths would have to be full and a dark grey border. (i don't need the symbols).
What ggplot (or other) command could replicate this design? Thanks for any direction. Really hoping I can recreate some of my favorite designs in R.

ggplot: Pallete Greyscale On Print, Colourful on Screen [duplicate]

I've started to produce the charts for a paper. For some of them which are bar charts I've used the "Pastel1" palette (as recommended in the book on ggplot2, pastel colours are better than saturated ones for fill areas, such as bars).
The problem with Pastel1 at least is that when printed on a B&W laser printer, the colours are indistinguishable. I don't know if the readers will view the paper on screen or will print it on B&W, so I'm looking for either of the following:
how to add hash lines to a palette such as Pastel1 (hopefully the hash lines are also subtle)
a colour palette easy on the eyes that also produces distinct grey areas for B&W for, say, up to 3-4 different colours.
Granted, I could find the latter by experimenting and using toner, but perhaps this has already been solved, I suppose it's a common problem. And yes, I did google for this, but didn't find anything pertinent.
Thank you.
Use http://colorbrewer2.org/ and only show colour schemes that are printer friendly.
Also see scale_fill_grey.
Currently it's not possible to used hash lines due to a limitation in the underlying grid drawing package.
There is the col2grey function in the TeachingDemos package that will convert a set of colors to an approximation of the grey color that will result from printing. You can use this to try different pallettes without wasting toner/paper.
Use this to select another color combination (gray scale option included)

images ds3.js heatmap

I am having trouble determining if you can create a heatmap with DS3 or R that can map onto a list of icons. Specifically wanted to use little people icons like these http://goo.gl/Yt8CG and then show concentrations of activity onto them. I am fairly new to data visualization with DS3.js and R so I might not be doing the right google-fu. Thanks ahead of time if anyone can show me an example or let me know if you CAN do shading on icons not just dynamically generated blocks like http://bl.ocks.org/mbostock/4063318
The basic approach is no different from drawing a normal heatmap (see for example here). The only difference would be that instead of appending rectangles, you append a container for the graphic that you want to use.
Whether you would be able to adjust the shading depends on the graphic itself -- if it's a bitmap you're out of luck. If it's an SVG for example you can simply select the path inside that SVG and set the fill color just like you would for a rectangle in a normal heatmap.

R: using hatched fill in plots

I was using R to make some plots for a report. I see that the plots don't seem to be so smooth. I am new to R so don't know much. But how do I get smooth plots?
Also by default the plots are filled with solid colors but I want to have hatched fills in my pie charts and bar plots. Is there a way to do that in R, I couldn't find it through a basic google search so I put this question here.
Did you try help(pie)?
density: the density of shading lines, in lines per inch. The default
value of ‘NULL’ means that no shading lines are drawn.
Non-positive values of ‘density’ also inhibit the drawing of
shading lines.
pie(c(1,2,3),density=c(1,2,20))
hist(runif(200),density=c(10,20,30))
Note that cross hatching and filling with lines is a hold over from the days when the only way to get quality graphics was with pen plotters (devices that literally drew the plot using a mechanical arm and a pen). Solid fills did not work well on those devices, often making holes in the paper when trying.
Now with high quality monitors and printers, solid fills are prefered, in fact research has shown that cross hatching can cause optical illusions due to the Moire effect, so are best avoided.
Pie charts are also best avoided, the only thing they do better than bar charts is hide and obscure data. Dotplots are becoming prefered to bar charts and with dotplots you don't need to worry about fills.
I know this does not answer the question you asked, but it does answer the one you should have asked.
The idea that hatching should be consigned to the history books is all well and good, but there are still situations where you have to use hatching rather than solid fills - i.e. when you have to present something in black and white. Many academic journals, for instance, still only have black and white figures so using solid fills isn't an option if you want to do a stack chart with more than a few options.

Resources