[R] filled.contour formatting questions
jim at bitwrit.com.au
Tue Mar 23 04:32:56 CET 2010
On 03/23/2010 12:48 PM, John K. Williams wrote:
> Hello, I'm having some trouble getting things to look as I want with
> 1. My first issue is that I am unable to add line segments to my plot where
> I want them. Using the rug pattern example:
> x<- y<- seq(-4*pi, 4*pi, len = 27);
> r<- sqrt(outer(x^2, y^2, "+"));
> The line segment is not found in relation to the x-axis but is seemingly
> squished over by the color bar.
> If I try to achieve the line this way:
> Now when I add the axis back it is misaligned.
> 2. Secondly I'm finding the literature difficult to understand on how to
> make a nice color scheme. Below is a nice scheme I found from an example,
> except I don't understand why the scale seems to cycle into blue again for
> larger values, even though I think I am setting the number of levels of
> colors and contour levels to be equal. Basically I want reds for the
> highest values and blues for the lowest:
> 3. I'm used to working with matlab where it was simple to make the color
> scale the same on multiple figures using caxis(). However I don't see this
> option for filled.contour (possibly it exists for levelplot() but I was
> having even less success understanding that one). I only see the option to
> set the number of levels which doesn't really accomplish what I want for
> plots that are going to have widely varying limits.
I'm not sure that this is what you want, but the examples for the barp
function in the plotrix package include one for a color scale that
extends beyond the values that are to be plotted. That is, you can
specify the range of the color scale regardless of the actual values.
More information about the R-help