legend

Android XYPlot set width of line, size of point and disable legend

不羁岁月 提交于 2019-12-24 06:38:40
问题 I'm trying to change width of line in XYPlot and size of point, any suggestion? And another question - how i disable legend to SimpleXYSeries? Set to null cause Error. 回答1: I'm trying to change width of line in XYPlot and size of point. Any suggestion? As shown here, you can alter the line thickness using either setSeriesStroke() or setBaseStroke() in your chosen renderer. Assuming XYLineAndShapeRenderer , you can change the rendered Shape using the approach shown here. How I disable the

Global legend for subplots with different content

只愿长相守 提交于 2019-12-24 06:33:43
问题 I read through previous solutions but couldn´t make any of them work. I want to have a global legend for individual subplots. The ax objects for this subplot are generated by a predefined function "get_plot" out of a predefined class "The_predefined_plotting_class" roughly like this: the function returns an ax object and each ax objects has multiple "plots"/ from multiple columns of the original "datafiles". In one of the solutions i found on this site i read that i could use: to make a

How can I plot a legend in R without plotting symbols and still get it to align nicely?

余生颓废 提交于 2019-12-24 05:34:45
问题 Can I create a plot legend which doesn't have plotting symbols and that the text itself is fitted to the border box? For example, in the following code there is a gap before the legend text that I want to get rid of: plot(c(1,2,3),c(1,1,1)) abline(v=c(1.5,2,2.5),col=c("blue","red","green")) legend("topright",legend=c("legend 1","legend 2","legend 3"),text.col=c("blue","red","green")) 回答1: Something you can try : # draw your legend without the border and with the text left-aligned and save the

Chartjs labels and legend

落爺英雄遲暮 提交于 2019-12-24 03:07:57
问题 I have an application which contains some ChartJS. Charts work well and legend is shown when mouse is hover the chart. How can I configure charts to have legend and labels value all the time on chart, not only when hover. 来源: https://stackoverflow.com/questions/38465624/chartjs-labels-and-legend

How to customize a legend in matlab plot window

泪湿孤枕 提交于 2019-12-24 02:56:31
问题 As shown in the image below, the legend is too long for the plot window. what I want to do is: 1- To know how to split the legend over a second line? 2- To know how to shorten the red line in indicated in the legend. As you see, the legend contains a red line then (x1=......), I want to know whether there is any possibility to shorten that red line or to control its length. 回答1: There are two possibilities to control the content of the legend: Use of TeX commands : MATLAB parses the legend

ggplot legend key color and items

末鹿安然 提交于 2019-12-24 01:45:24
问题 Using the following data frame: sdf<-data.frame(hours=gl(n=3,k=1,length=9,labels=c(0,2,4)), count=c(4500,1500,2600,4000,800,200,1500,50,20), machine=gl(n=3,k=3,length=9,labels=c("A","B","C"))) The following graph can be produced using either of these scripts: ggplot(data=sdf,aes(x=hours,y=count,group=machine,fill=machine))+ geom_area(data=sdf[sdf$machine=="A",])+ geom_area(data=sdf[sdf$machine=="B",])+ geom_area(data=sdf[sdf$machine=="C",]) ggplot(data=sdf,aes(x=hours,y=count,group=machine

add legend to ggplot2

北战南征 提交于 2019-12-24 00:47:24
问题 I've been trying to add legend to my ggplot but failed miserably. I did go through other asks which were related to adding legends manually such as 1,2 but couldn't apply the answerson my ggplot. I tried the function scale_colour_manual but the legend doesn't show up. Any help would be much appreciated. p <- ggplot() + # corine plot geom_point(data=t, aes(x=FPR, y=TPR),colour="black", size =3,pch=1) + geom_line(data=t, aes(x=FPR, y=TPR), colour="lightblue", size=1) + #globecover plot geom

In ggplot, how can I get two legends (“gradient” type) for stat_bin2d?

旧巷老猫 提交于 2019-12-23 19:27:46
问题 Here I have two 'clusters', and just one legend. How can I get two "density" legends with two different color gradients? I have tried group but it does not work. The following code generated the above graph: library(ggplot2) df <- data.frame(x=c(rnorm(1000,1,.1),rnorm(1000,3,.1)), y=c(rnorm(1000,1,1),rnorm(1000,3,1)), type=c(rep('a',1000),rep('b',1000))) plot( ggplot(df) + stat_bin2d(aes(x,y,fill=..density..,group='type'))) 回答1: I'm not aware of a way to specify more than one fill gradient.

Create legend for scatter plot using the label of the samples in matplotlib

耗尽温柔 提交于 2019-12-23 18:17:45
问题 I am using scatter plot in matplotlib to plot some points. I have two 1D arrays each storing the x and y coordinate of the samples. Also there is another 1D array that stores the label(to decide in which colour the point should be plotted). I programmed thus far: import matplotlib.pyplot as plt X = [1,2,3,4,5,6,7] Y = [1,2,3,4,5,6,7] label = [0,1,4,2,3,1,1] plt.scatter(X, Y, c= label, s=50) plt.show() Now I want to be able to see which color corresponds to which label? I looked up the

Gnuplot, how to include a space character in key titles?

大兔子大兔子 提交于 2019-12-23 18:07:19
问题 I want to use key titles like "Best F" "Worst F" for a gnuplot 4.4 graph, when reading the data from a file, but I can't figure out how to put the space, e.g.: Generation Best_F Worst_F Average_F 5 4 9 5 4 3 9 4 I tried writing in the file "Best F", "Best%20F" "Best\ F" but they get split, when read as column headers, or I get the ugly looking "%20". plot for[col=2:4] data.dat using 1:col title columnheader(col) Or is there a way to do a character substitution, like "Best_F"%" "->"Best F"?