legend

Highcharts: structure legend by subtitles

余生颓废 提交于 2019-12-08 01:16:11
问题 I was playing around with Highcharts the last days. One thing, I couldn't find out, is if it is possible to include subtitles to the legend to structure the results. In my example: http://jsfiddle.net/gWEtB/ var allData={ products: ["Product1", "Product2", "Product3", "Product4"] } var colors={ 'own': ['#3B14AF', '#422C83', '#210672', '#886ED7'], 'comp': ['#E7003E', '#AD2B4E', '#960028', '#F33D6E', '#F36D91'], 'new': '#00CC00'} `$(function () { $('#container').highcharts({ chart: { type:

Assigning color to the rectangle near legend items in wpf toolkit charting lineseries

安稳与你 提交于 2019-12-08 00:23:51
问题 I am adding lineseries to a chart dynamically as follows. foreach (KeyValuePair<string, List<KeyValuePair<DateTime, double>>> tempSeries in yieldSeries) { LineSeries lineSeries = new LineSeries(); lineSeries.DependentValuePath = "Value"; lineSeries.IndependentValuePath = "Key"; lineSeries.ItemsSource = tempSeries.Value; lineSeries.Title = tempSeries.Key; lineSeries.SetResourceReference(FrameworkElement.StyleProperty,"CommonLineSeries"); lineSeries.Tag = Brushes.Red; lineSeries.Background =

Add multiple legends to ggplot2 when using geom_sf

断了今生、忘了曾经 提交于 2019-12-07 19:31:32
问题 My question combines two separate issues posted on before on Stackoverflow: i. Adding multiple legends to ggplot and ii. Add line legend to geom_sf. I would like to add multiple legends to ggplot2 (as in the first post), but am using sf . This complicates filling up the aesthetic space. The answer suggested in i. above does not work well with multiple types of geometries -- we cannot assign points and lines to a single class and then use factors. In my case, I have several line and point

setting space between legend/pattern with the text in stacked bar-chart

感情迁移 提交于 2019-12-07 18:12:54
问题 I have gnuplot data file: CS 31.73 18.32 20.78 22.88 1.97 1.29 0.90 2.01 FL 43.27 29.45 15.64 6.55 1.64 1.27 2.18 0.00 HB 32.44 20.43 14.89 14.53 5.42 10.92 0.80 0.31 HD 28.53 7.27 29.53 20.33 9.18 0.93 2.04 1.44 MR 22.56 36.19 10.66 15.51 9.45 4.32 0.80 0.31 ZK 27.15 10.81 27.40 16.10 8.05 7.24 1.06 1.71 All 30.00 21.35 18.05 16.82 6.14 5.39 1.11 0.85 And my gnuplot Script: set term pos eps font 20 set style data histogram set style histogram rowstacked set key invert reverse above set

Editing legend labels in ggplot

﹥>﹥吖頭↗ 提交于 2019-12-07 17:33:39
问题 I have a dataframe that looks like this: data median min max no_of_threads 2.33 2.10 6.85 1 2.43 2.14 3.41 2 2.39 2.13 7.90 3 2.74 2.10 8.30 4 2.53 2.21 6.69 5 I made this R function, that plots data$min and data$max as range, and data$median as line: scalability_graph <- function(data){ h <- ggplot(data) h <- h + geom_ribbon(aes(x = no_of_threads, ymin = min, ymax = max)) + geom_line(aes(x = no_of_threads, y=median, color="#CC873D")) + scale_x_continuous("Number of threads", lim=c(0,20)) +

Set color for border of legend of JFree Chart

99封情书 提交于 2019-12-07 17:24:48
问题 Problem is formulated in title. Details: I have code in class-theme for set specific non-default-color for the border of legend frame. LegendTitle legend = jFreeChart.getLegend(); legend.setWidth(100); After this I need to set color for border of legend, but nothing like legend.setBorderColor(Color.green) I couldn't found. Help me, please. Thanks for replies. 回答1: You can specify a new color when you replace the legend's border: LegendTitle legend = chart.getLegend(); legend.setFrame(new

R, ggplot2: creating a single legend in a bubble chart with positive and negative values

一笑奈何 提交于 2019-12-07 15:06:47
问题 I want to create a single legend for a bubble chart with positive and negative values like in plot below, generated using sp::bubble(). But, for various reasons I want to duplicate this in ggplot2. The closest I have gotten is to generate a single legend with scaled symbols, but the actual bubbles themselves are'nt scaled. The above plot was created using the code below # create data frame x=sample(seq(1,50),50,T) y=sample(seq(1,50),50,T) plot_dat=data.frame(x=x,y=y,value=rnorm(50,0,25)) #

Fix legend title when using superscript in more than two lines - R ggplot2

梦想与她 提交于 2019-12-07 14:28:11
问题 I am plotting a map of my study area and I am having problems to edit the legend title. I need it to be "Projected fruit productivity in fallows in 40 yrs (fruits ha^-1) written in four lines. I could use bquote() to plot the -1 as a superscript. But it created an extra space that I cannot figure it out how to take it off. The extra space only appears when the title is divided into multiple lines. Also, expression(atop()) creates the superscript but once I tried to divide it into more than

Using a miniature version of the plotted data as the legend handle in python

送分小仙女□ 提交于 2019-12-07 14:24:48
问题 Is there any way to use the line plotted in a figure in matplotlib as the handle in the legend? I'm thinking for example in this basic code rather than a straight line in the legend have a small version of the sine wave I've plotted as the handle. import matplotlib.pyplot as plt import numpy as np x = np.arange(0,15,0.1) y = [np.sin(x1) for x1 in x] plt.plot(x,y, label = 'sine wave') plt.legend() plt.show() Thanks in advance! 回答1: I thought this was a pretty fun question. Most of the

Using annotate to place a text box below legend in Matplotlib

折月煮酒 提交于 2019-12-07 13:59:58
问题 I wish to display some text in a Matplotlib plot using annotate(), aligned beneath a legend box. I have examined the solution proposed in How to place a text box directly below legend in matplotlib? and can make an adaption that works for my situation, however adding additional axes etc. seems overkill for my situation. I simply wish to place an annotation whose top right corner is 20 pixels below the lower right corner of the legend box. I also wish to save a PDF files of the plot. Here is