legend

Highchart Legend into another Element (div)

荒凉一梦 提交于 2020-01-03 08:49:10
问题 i need another Highchart Legend which i want to style with css/html. I found a topic with this topic but I can't get it to work and the jsFiddle Link isn't working anymore... Can someone help me to get this working? Please Here is my jsfiddle Link http://jsfiddle.net/chogger/j3xvg This is what I found: $(chart.series).each(function(i, serie){ $('<li style="color: '+serie.color+'">'+serie.name+'</li>').click(function(){ serie.visible ? serie.hide() : serie.show(); }).appendTo('#legend') }) 回答1

Matplotlib: Multiple legends for contour plot for multiple contour variables

只愿长相守 提交于 2020-01-03 02:47:06
问题 I need to make multiple contours plots of several variables on the same page. I can do this with MATLAB (see below for MATLAB code). I cannot get matplotlib to show multiple legends. Any help would be much appreciated. Python code: import numpy as np from matplotlib import cm as cm from matplotlib import pyplot as plt delta = 0.25 x = np.arange(-3.0, 3.0, delta) y = np.arange(-2.0, 2.0, delta) X, Y = np.meshgrid(x, y) Z1 = X*np.exp(-X**2-Y**2) Z2 = Y*np.exp(-X**2-Y**2) plt.figure() CS = plt

How to add a custom legend for geom_hline

最后都变了- 提交于 2020-01-02 08:50:07
问题 Using the data below, notice the legend does not properly describe geom_hline: df<-data.frame( points=c(.153,.144,.126,.035, .037, .039, .010,.015,.07), days=gl(3,1,9,labels=c("Sun","Mon","Tues")), lang=c("en","en","en","pt","pt","pt","ko","ko","ko")) ggplot(data=df[df$lang=="en",])+ geom_point(aes(x=days,y=points),size=5,colour='cyan',show_guide=F)+ geom_point(aes(x=days,y=points,colour=days),size=4,show_guide=F)+ facet_wrap(~lang,ncol=1,scales="free")+ xlab("")+ ylab("")+ scale_y_continuous

How do I include a superscript to texts on a plot on R?

徘徊边缘 提交于 2020-01-02 01:05:10
问题 I need it to look like this: R^2 = some values And I've tried the code below but it wouldn't work, it came out as "R (expression (^2)) = some values" instead: text (25, 200, paste ("R (expression (^2)) =", round (rsquarelm2, 2))) 回答1: You don't want a character vector, but an expression, hence this expression(R^2 == 0.85) is what you need. In this case, you want to substitute in the result of another R operation. For that you want substitute() or bquote() . I find the latter easier to work

ggplot2: center legend below plot instead of panel area

核能气质少年 提交于 2020-01-01 12:30:08
问题 ggplot by default centers the legend below the panel, which is really frustrating in some situations. Please see the below example: ggplot(diamonds, aes(cut, fill = clarity)) + geom_bar() + coord_flip() + theme(legend.position = 'bottom') It can be seen that the last label was cropped from the image, although we have some white-space on the left part of the legend -- it would be a lot better to use that. Q : how can I center the legend below the plot and not try to force that to be centered

Add legend to a plot with R

你。 提交于 2020-01-01 09:47:13
问题 I create 4 line in one plot using R . Here the code # Define 2 vectors cars <- c(123.07, 110.51, 96.14, 98.71, 101.3) trucks <- c(110.31, 89.91, 89.81, 89.31, 93.4, 95.81) cars1 <- c(123.227, 110.221, 93.14, 98.22, 122.3) trucks1 <- c(120.31, 89.91, 89.81, 89.31, 93.4, 95.81) # Graph cars using a y axis that ranges from 0 to 12 plot(cars, type="o", col="blue", ylim=c(80,130)) # Graph trucks with red dashed line and square points lines(trucks, type="o", pch=22, lty=2, col="red") lines(cars1,

matplotlib two legends out of plot

懵懂的女人 提交于 2020-01-01 07:05:13
问题 I'm facing problem with showing two legends outside of plot. Showing multiple legends inside plot is easy - its described in matplotlib doc's with examples. Even showing one legend outside of plot is rather easy as i found here on stackoverflow (ex. here). But i cant find working example to show two legends outside of the plot. Methods which work with one legend is not working in this case. Here is an example. First of all base code: import matplotlib.pyplot as plt import matplotlib.patches

Setting line colors in legend of MATLAB plot?

我的未来我决定 提交于 2020-01-01 06:47:58
问题 I am using the plotgauss2d function of BNT to visualize how the response of a 2D Gaussian node changes when evidence is observed elsewhere in the net. eng = jtree_inf_engine(bnet); evidence = cell(1, 2) eng = enter_evidence(eng, evidence); marginals = marginal_nodes(eng, 1); p_1 = marginals.T marginals = marginal_nodes(eng, 2); p_2 = marginals.T marginals clf; plotgauss2d(marginals.mu, marginals.Sigma); hold all; evidence{1} = 1; marginals = marginal_nodes(enter_evidence(eng, evidence), 2); p

Create legend in R with identical RGB color values as plot?

百般思念 提交于 2020-01-01 03:26:09
问题 I've created a simple scatter plot in R with specific RGB color values like this: plot(shuffled, p_val, pch=19, col="black", xlim=c(0,100), ylim=c(0,1)) points(ri, p_val, pch=19, col=rgb(96,123,139, 50, maxColorValue=255), xlim=c(0,100), ylim=c(0,1)) points(somo, p_val, pch=19, col=rgb(225,64,5, 50, maxColorValue=255), xlim=c(0,100), ylim=c(0,1)) I would like to use the same color values in the code above to generate a figure legend. The code I am using looks like this, but I can't seem to