legend

How to add data table with legend keys to a MS Chart in C#?

陌路散爱 提交于 2019-12-17 07:55:34
问题 There are 2 lists called listversion & MIN_list . Using values of these list I have created a line chart. Everything is work fine. But I am wondering whether it is possible to add a data table with legend keys in to the chart like MS Excel. chart.Series.Clear(); chart.ChartAreas[0].AxisX.Title = "Version"; chart.ChartAreas[0].AxisX.TitleFont = new System.Drawing.Font("Arial", 12, FontStyle.Regular); chart.ChartAreas[0].AxisY.Title = "Time"; chart.ChartAreas[0].AxisY.TitleFont = new System

Is it possible to add a string as a legend item in matplotlib

这一生的挚爱 提交于 2019-12-17 07:26:27
问题 I am producing some plots in matplotlib and would like to add explanatory text for some of the data. I want to have a string inside my legend as a separate legend item above the '0-10' item. Does anyone know if there is a possible way to do this? This is the code for my legend: ax.legend(['0-10','10-100','100-500','500+'],loc='best') 回答1: Sure. ax.legend() has a two argument form that accepts a list of objects (handles) and a list of strings (labels). Use a dummy object (aka a "proxy artist")

Is it possible to add a string as a legend item in matplotlib

半城伤御伤魂 提交于 2019-12-17 07:26:02
问题 I am producing some plots in matplotlib and would like to add explanatory text for some of the data. I want to have a string inside my legend as a separate legend item above the '0-10' item. Does anyone know if there is a possible way to do this? This is the code for my legend: ax.legend(['0-10','10-100','100-500','500+'],loc='best') 回答1: Sure. ax.legend() has a two argument form that accepts a list of objects (handles) and a list of strings (labels). Use a dummy object (aka a "proxy artist")

Remove extra legends in ggplot2

╄→尐↘猪︶ㄣ 提交于 2019-12-17 03:28:09
问题 I have a simple data frame that I'm trying to do a combined line and point plot using ggplot2 . Supposing my data looks like this: df <- data.frame(x=rep(1:10,2), y=c(1:10,11:20), group=c(rep("a",10),rep("b",10))) And I'm trying to make a plot: g <- ggplot(df, aes(x=x, y=y, group=group)) g <- g + geom_line(aes(colour=group)) g <- g + geom_point(aes(colour=group, alpha = .8)) g The result looks fine with one exception. It has an extra legend showing the alpha for my geom_point layer. How can I

How to display legend for Pie Chart in columns?

末鹿安然 提交于 2019-12-17 02:33:12
问题 I have a PieChart with many sections, legend for this PieChart renders as one row. How to render legend as two columns? 回答1: The method getLegendItem() , seen here, provides all the information needed to render a legend item in any Container you choose. GridLayout(0, 2) will arrange them in two columns for any number of rows. To suppress the existing legend, set legend to false when you call your chart factory; the items will still be available, as suggested here. Addendum: Based on

Matplotlib scatter plot legend

白昼怎懂夜的黑 提交于 2019-12-17 02:29:16
问题 I created a 4D scatter plot graph to represent different temperatures in a specific area. When I create the legend, the legend shows the correct symbol and color but adds a line through it. The code I'm using is: colors=['b', 'c', 'y', 'm', 'r'] lo = plt.Line2D(range(10), range(10), marker='x', color=colors[0]) ll = plt.Line2D(range(10), range(10), marker='o', color=colors[0]) l = plt.Line2D(range(10), range(10), marker='o',color=colors[1]) a = plt.Line2D(range(10), range(10), marker='o'

Plot a legend outside of the plotting area in base graphics?

橙三吉。 提交于 2019-12-16 20:03:30
问题 As the title says: How can I plot a legend outside the plotting area when using base graphics? I thought about fiddling around with layout and produce an empty plot to only contain the legend, but I would be interested in a way using just the base graph facilities and e.g., par(mar = ) to get some space on the right of the plot for the legend. Here an example: plot(1:3, rnorm(3), pch = 1, lty = 1, type = "o", ylim=c(-2,2)) lines(1:3, rnorm(3), pch = 2, lty = 2, type="o") legend(1,-1,c("group

Line plot legend does not appear

≡放荡痞女 提交于 2019-12-14 04:02:14
问题 I am trying to plot a line plot in r by using ggplot. Unfortunately, the legend does not show up. Can anyone help me? My code looks like the following: dfdatavgsM=data.frame(datum, avgsätzegespMT, avgsätzegespML) ggplot(data = dfdatavgsM, aes(x=datum, color=Wettbewerbsart)) + geom_line(data=dfdatavgsM, aes(y = avgsätzegespML),color="red") + geom_line(data=dfdatavgsM, aes(y = avgsätzegespMT), color="blue") + geom_vline(xintercept=2011, size = 0.6) + scale_y_continuous(name="Anzahl an Sätzen")

Generating a legend in ggplot2

末鹿安然 提交于 2019-12-13 23:34:49
问题 I tried to generate a legend for my ggplot, where I want to illustrate five different lines over a time horizon of 2,5 months with 11 datapoints. I can generate the graph, but it doesn't work to get the legend comparing to the colors and names of the lines. I tried different commands, i.e. scale_colour_manual, scale_fill_discrete, opts, guides,... but nothing works. I don't know what's wrong.. Can please anybody help me? Here are the commands to the define the data frame. Spaß <- read.csv

ploting ggmap with geom Points (lat_long) annotated 1 to19. Points data is in CSVfile

亡梦爱人 提交于 2019-12-13 23:04:45
问题 I am plotting with ggmap and ggplot2 using geom_point . I want to add annotation text (i.e., 1 to 19) close to the points as well. Here is my code: setwd("../Documents/MAPS") library(ggplot2) library(mapproj) library(maps) library(maptools) library(rgdal) library(ggmap) library(sp) bdl_sites <- get_map(location =c(lon = 34.832, lat = 0.852), colour = "colour", source = "google", maptype = "terrain", zoom = 9) save(bdl_sites, file = "bdl_sites.rda") load(file = "bdl_sites.rda") BDL_Org_Data