colorbrewer

How to recycle colours in a colorbrewer palette using line symbols

爷,独闯天下 提交于 2020-01-22 20:02:25
问题 I'm using ggplot2 to create quite a few facet_wrap ped geom_line plot. Although each plot only has a maximum of eight lines, when taken together, there are more like twenty categories to show on the legend. In a similar vein to this: Recommend a scale colour for 13 or more categories and this: In R,how do I change the color value of just one value in ggplot2's scale_fill_brewer? I'd like to artificially up the number of colours I can show using colorbrewer's high-contrast colour sets. An

horizontal barplot with color gradient from top to bottom of the graphic

99封情书 提交于 2019-12-24 10:47:04
问题 I would like to fill the bars in a gradient of color from the top to the bottom of the graphic. That is, regardless of the bar lenght, the color should be getting lighter trhough the top to the bottom direction. I created 2 SIMULATIONS in the photoshop. The first one (Fig. 1) is that ploted through the follow script (long bars are dark and short bars are light). However the seconde one (Fig. 2) is that I would like to elaborate (the top bars are dark and get lighter in the bottom direction).

Colour Map on scatter plot [duplicate]

有些话、适合烂在心里 提交于 2019-12-13 23:30:28
问题 This question already has answers here : Matplotlib scatterplot; colour as a function of a third variable (3 answers) Closed 3 years ago . I have three columns in a csv file which reads like this: X,Y, Cosine efficiency 989.565,670.17,0.868684456 660.941,-1502.48,0.597998523 685.683,-1491.35,0.600137189 -1454.88,-316.582,0.666894492 -510.86,1016.79,0.870398677 -1350.21,-788.027,0.61601682 -944.034,-1342.79,0.565497692 -966.098,-1327,0.56678693 -1206.4,-1054.63,0.590095562 1004.18,648.067,0

ggplot2: use scale_colour_brewer() and specify legend name / entry labels manually

被刻印的时光 ゝ 提交于 2019-12-13 05:39:21
问题 I want to use scale_colour_brewer() and scale_fill_brewer() to specify the fill or colours via the brewer palette: diagram <- diagram + scale_colour_brewer() + scale_fill_brewer() Nevertheless, I still want to set the legend label and its entries manually. I did so formerly via: diagram + scale_colour_manual(name="Cumulative Percentage", values=c("#d7191c","#fdae61","#000000","#abdda4","#2b83ba"), labels=c("GN","GN1","GN2","GN3","GN4")) How can I use the auto-palette feature, while still

ggplot2 horizontal barplot with gradient color fill

主宰稳场 提交于 2019-12-12 17:47:58
问题 I am trying to create horizontal bar plot and would like to fill the individual bar as per their log fold values, white for lowest value and darkest for highest value. However, I am not able to do it. Here is my work, can somebody help me fix it? df <- data.frame(LogFold = c(14.20, 14.00, 8.13, 5.3, 3.8, 4.9, 1.3, 13.3, 14.7, 12.2), Tissue = c("liver", "adrenal", "kidney", "heart", "limb", "adipose", "brown", "hypothalamus", "arcuate", "lung")) df1<-df%>% arrange(desc(LogFold)) ggplot(data

Can I adjust the lower limit of scale_color_brewer?

戏子无情 提交于 2019-12-10 14:57:17
问题 I have ordered categorical data that I would like to use color brewer on. But I have a hard time seeing the very light lower values. Is there a way to either trim off those lower values or set the lower limit in the scale? ggplot(data.frame(x=1:6, y=10:15, w=letters[1:6]), aes(x, y, color=w)) + geom_point()+ scale_color_brewer(type="seq", palette=1) + theme_bw() Is there a better way to do this? So far I either see qualitative scales that aren't ordered or continuous scales that don't like

ggplot2/colorbrewer qualitative pallette with 125 categories

北慕城南 提交于 2019-12-07 03:28:49
问题 I have data as follows: 10 states Each state has two types Each type has between 1 and 29 entities Each state-entity-type has a count Complete data available as a gist. I'm trying to visualize what proportion of the counts were made for each entity. To do that, I've used the following code: icc <- transform( icc, state=factor(state), entity=factor(entity), type=factor(type) ) p <- ggplot( icc, aes( x=state, y=count, fill=entity ) ) + geom_bar( stat="identity", position="stack" ) + facet_grid(

Low, med high colors for deciles in ggplot

大兔子大兔子 提交于 2019-12-05 02:44:58
问题 I want to have a polygon type of spatial plots using ggplot. In which, polygons are plotted and color of polygons are decided by its weight. Sample data frame look like - (here is the data file CompleteDataFile) polyNr x y centroidX centroidY weight 1 4459425.25 5328202.595264193 4459675.25 5328202.595264193 -13.055709633886783 1 4459550.25 5328419.101615138 4459675.25 5328202.595264193 -13.055709633886783 1 4459800.25 5328419.101615138 4459675.25 5328202.595264193 -13.055709633886783 1

how to color a qualitative gradient with R (using independent categories / multiple dimensions)

落爺英雄遲暮 提交于 2019-12-02 02:42:00
问题 sorry if i'm missing something fundamental about how colorRampPalette and brewer.pal work, but how can you create a qualitative color gradient based on multiple variables? my goal is to create a multidimensional qualitative gradient like the image shown below (red-to-green, red-to-yellow, red-to-blue and not red-to-yellow-to-green-to-blue). minimal a reproducible example: # example data set mydata <- data.frame( v = runif( 100 ) , w = runif( 100 ) , x = runif( 100 ) , y = runif( 100 ) , z =

how to color a qualitative gradient with R (using independent categories / multiple dimensions)

风流意气都作罢 提交于 2019-12-02 01:14:12
sorry if i'm missing something fundamental about how colorRampPalette and brewer.pal work, but how can you create a qualitative color gradient based on multiple variables? my goal is to create a multidimensional qualitative gradient like the image shown below (red-to-green, red-to-yellow, red-to-blue and not red-to-yellow-to-green-to-blue). minimal a reproducible example: # example data set mydata <- data.frame( v = runif( 100 ) , w = runif( 100 ) , x = runif( 100 ) , y = runif( 100 ) , z = runif( 100 ) ) # five columns of random values between zero and one # use three columns with the `rgb`