rCharts - Manipulating Background Color and Suppressing Axes - r

These are probably separate questions but they both relate to controlling the look of an rCharts/Polycharts plots (to that end, my meta-question is: Where can I find a complete source for all the fields/methods for rCharts/Polycharts?)
My specific questions are:
1) How do I change the background color of the plot? Specifically, I need a color background instead of the default white.
2) How do I suppress the axes (and associated labels and ticks)?
Most of the SO posts with workarounds for the above are for nvd3.
The documentation found here:
https://media.readthedocs.org/pdf/rcharts/latest/rcharts.pdf
Was mostly just some basic examples, but nothing covering the above. I did find this thread on github from 2 years ago, noting that complete documentation was on the to-do list.
https://github.com/ramnathv/rCharts/issues/221
So maybe I'm just not finding it?
Thanks

Related

add legend to graph according to node colors using Rcy3

I'm an advanced R user, but have just started recently using Rcy3 to create better visualisations of my graphs.. problem is I don't know how to add a legend to my figure that would explain the coloring of my nodes.
You may want to look at the app "LegendCreator". It's sort of in the beta stage, but it can be useful particularly for gradient legends. It also supports automation, although generally, you'll want to manually position the legend.
-- scooter

Building a heatmap in R with more information

I made a heatmap on R and most of it is one colour. I have two columns of data which showed up as various colours, but the rest of it is red.
Does anyone know how to increase the "resolution" of this? I don't mean anything about how to make the image more clear (which is why I think I'm having trouble searching for info on it). I mean, how do I make my heatmap more meaningful and not all mostly one colour.
Thanks and sorry if this has been answered somewhere else. I think I don't know the key term I need to search properly.
Edit:
Here is the code I used so far (heatdata is my matrix):
heatmap <- heatmap(heatdata,Rowv=NA,Colv=NA,col=cm.colors(256),scale="row")

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)

Are there good predefined color sequences for different data in one plot?

A while ago, I asked How to change Lattice graphics default groups colors?, and got a helpful response from BenBarnes. This allowed me to define more than 7 cycling colors for different data in the same plot in R's Lattice package, which I did. However, I found that it's difficult to define more than 9, maybe 10 colors are not (a) hard to see on a white background, or (b) include pairs of colors that look very similar. (That might be why seven colors is Lattice's default, obviously.) It occurs to me, though, that there are people out there who are much better at managing colors in information display than I am, and that maybe someone had already defined a good list of 10, 12, maybe even 15 colors for display of data in the same plot. Anybody know of such a list? Any color specification that I can convert into a Lattice format would work. If it's already been done in Lattice, even better! (Is there a better place to ask this question??)
There's a large body of work on choosing colors. Check out the RColorBrewer and colorspace packages as a starting point. In the documentation for colorspace there is a link to an excellent paper (and the vignette summarizes much of the paper). And think about your color blind colleagues, with dichromat.
In general, I think it is very difficult to pick a large set of colors that don't end up being hard to distinguish from one another. When I am looking for a large number (>8) of colors that I want to be noticeably distinct and aesthetically pleasing, I usually use the rich.colors palette in the gplots package. I find it more useful than the similar rainbow palette, because the colors don't wrap around on each other.

ggplot2 use different palettes for different layers

I am currently trying to put a boxplot below a jitter, and want to color the boxes in a lighter shade.
So in opposite to this post https://stackoverflow.com/a/9236205/1842673 I just could add a '+' instead of the '-' in the line
cols_dk <- rgb2hsv(col2rgb(colour)) - c(0, 0, 0.2)
However, since as mentioned in the last answer on that page "proto" was discontinued, I can not seem to get this to work. Is there another (new) way to reach that point?
I also tried to just add
+scale_color_hue(l=80)
Directly after the layer definition, however, this then applies to the whole plot (also to the jitter layer.
In this request https://github.com/hadley/ggplot2/issues/723 a more general solution has been asked for, so if there is someone here, who could help with that, it would be a nice thing as well...
Any suggestions?

Resources