legend

Why won't my <legend> element display inline?

你。 提交于 2019-12-20 16:24:46
问题 I am trying to apply display: inline; to the <legend> element in my <fieldset> element, so that the following <span> will follow on the same line, but my CSS is having no effect. legend{ display: inline; } span { display: inline; } <fieldset> <legend>Legend</legend> <span>Follower</span> </fieldset> JSFiddle EDIT I have no control over the HTML; I can only edit CSS 回答1: Legends are special. In particular, their default rendering can't be described in CSS, so browsers use non-CSS means of

R - Smoothing color and adding a legend to a scatterplot

泪湿孤枕 提交于 2019-12-20 15:26:10
问题 I have a scatterplot in R. Each (x,y) point is colored according to its z value. So you can think of each point as (x,y,z) , where (x,y) determines its position and z determines its color along a color gradient. I would like to add two things A legend on the right side showing the color gradient and what z values correspond to what colors I would like to smooth all the color using some type of interpolation, I assume. In other words, the entire plotting region (or at least most of it) should

Vertical spaces in legend

我是研究僧i 提交于 2019-12-20 12:34:01
问题 I am having trouble formatting my legend. I would like to increase the vertical space between each element of the legend. I post the image it produces and the code so you can help me if you want. This is the code relative to the legend: par(fig = c(0, 1, 0, 1), oma = c(0, 0, 0, 0), mar = c(0, 0, 0, 0), new = TRUE) legend("right", c("$\\lambda < \\lambda_{cr}$ ", "$\\lambda < \\lambda_{cr}$", "$\\lambda = \\lambda_{cr}$ ", "$\\lambda = \\lambda_{cr}$ "), xpd = TRUE, inset = c(0,0), bty = "n",

One shared legend for a cowplot grid in R

被刻印的时光 ゝ 提交于 2019-12-20 10:24:16
问题 I just built a grid with package cowplot (to label the plots from A-D). The plots are made with package ggplot2 : pfour<-ggplot(four, aes(x=Concentration, y=Percentage, fill=Phenotype)) + geom_bar(stat='identity',color='black') + scale_fill_grey(start = .4, end = .9) + theme_bw()+ylab("Distribution") + xlab("Contentration [mg/ml]") + ggtitle("96 hpf") + theme(legend.title = element_text(colour="black", size=10, face="bold")) + theme(legend.background = element_rect(fill="white", size=0.5,

plot functions with filled point symbols and legend

只愿长相守 提交于 2019-12-20 09:31:51
问题 I want to plot two functions in different colors and point styles with a corresponding legend, in plain R . I have several questions: I am using pch=21 and pch=22 . My understanding is that they are "filled" symbols. They do appear filled as expected in the legend, but they appear hollow on the graph itself. What's wrong? Can I get more space between the points without specifying a grid manually? maybe by selecting the number of points to be printed? Feel free to add any kind of advice you'd

Add a legend to a ggplot2 scatter plot including additional lines

烈酒焚心 提交于 2019-12-20 04:48:02
问题 I would like to add a legend to a ggplot2 scatter graph which distinguishes between a regression line and a separate line I've added. For example, library(ggplot2) set.seed(123) data1=rnorm(1000,1,2) data2=rnorm(1000,1,4) DF=data.frame(data1,data2) ggplot(DF,aes(data1,data2))+geom_point(colour="dodgerblue",alpha=0.75)+geom_smooth(method=lm,se=F,aes(colour="Line of best fit"))+ geom_abline(intercept = 0, slope = 1, linetype="dashed", colour="black", alpha=1,size=1) There are two lines on this

Add a legend to a ggplot2 scatter plot including additional lines

你说的曾经没有我的故事 提交于 2019-12-20 04:47:14
问题 I would like to add a legend to a ggplot2 scatter graph which distinguishes between a regression line and a separate line I've added. For example, library(ggplot2) set.seed(123) data1=rnorm(1000,1,2) data2=rnorm(1000,1,4) DF=data.frame(data1,data2) ggplot(DF,aes(data1,data2))+geom_point(colour="dodgerblue",alpha=0.75)+geom_smooth(method=lm,se=F,aes(colour="Line of best fit"))+ geom_abline(intercept = 0, slope = 1, linetype="dashed", colour="black", alpha=1,size=1) There are two lines on this

Fieldset: Center legend

我们两清 提交于 2019-12-20 01:43:34
问题 as asked many times before (but never really answered) I want to center a legend in a fieldset. The trick was done perfectly here, which I also bought for my project: http://themeforest.net/item/aloma-liquid-mobile-template/full_screen_preview/5819068 the code from the css reads like this fieldset { display: block; margin: 20px 1%; margin-bottom: 20px; padding: 0 auto; padding: 15px 0; border: 0; border-top: 1px solid #DDD; width: 98%; } legend { display: table; min-width: 0px; max-width: 70%

How to put multiple colormap patches in a matplotlib legend?

这一生的挚爱 提交于 2019-12-20 01:41:08
问题 Situation at hand: I have multiple groups of lines, where the lines within the same group vary according to some group specific parameter. I assign each of these lines within the same group a color from a colormap according to this parameter using a different colormap for each group. Now, I would like to add a legend to the plot with one entry per group of lines. Solution for only one set of lines: If I had only one group of lines the best way of labelling would be to add a colorbar as

ggplot2: Shape, Color and Linestyle into one legend

允我心安 提交于 2019-12-19 10:48:19
问题 I want to create a ggplot2-diagram with lines and bars, visualizing different values y and ybar. The lines are overlayed with dots also based on values y. There should be 2 legends in the end, one for the line (+dot) diagram, comprising colours, shapes and linestyle, and one for the bars, comprising the fill colour. The linestyles, dot-shapes and colours are changed accordingly to the variable type (y1 or y2). This works well, until I manually want to set the legend name and the item labels: