legend

Change the color of legend symbol highchart

时光总嘲笑我的痴心妄想 提交于 2019-12-24 14:46:36
问题 Is it possible to change the legend symbol color in Highcharts? For example demo example contains two series and the symbols in legend are in blue and black (same as the series). I couldn't find any symbolColor param in the documentation. How do I change them both to say black? legend: { layout: 'vertical', floating: true, align: 'left', verticalAlign: 'top', x: 90, y: 45, symbolPadding: 20, symbolWidth: 50, symbolColor: '#000000' ????? }, 回答1: Add color for the legend in each series. series:

add legend matlab plot

╄→尐↘猪︶ㄣ 提交于 2019-12-24 13:25:36
问题 I have a matlab function myfunction(var1,var2) which gives me a plot with a legend. I would like to generate more plots with this function in one graph. This works so far i.e. for 2 plots in one graph with: myfunction(a,b) hold on myfunction(c,d) hold off The problem here is that the legend which is generated for each plot with: legend(sprintf('%s%s',var1,' on ',var2)) legend('boxoff') is only appearing for the last instance of myfunction (in this case with myfunction(c,d) , there would be

How to make legend in R?

牧云@^-^@ 提交于 2019-12-24 13:19:27
问题 I have data that falls into one of many categories. Here is a very simplified version of what I'm doing to my data. I want to make a scatterplot where different colors represent different categories. However, there are many different categories so instead of manually choosing the colors, I'm letting R choose for me by setting col=data$category within the plot function. However, I can't figure out how to generate a legend -- every parameter that I put inside the legend function never actually

How to get constant distance between legend and axes even when the figure is resized?

谁都会走 提交于 2019-12-24 11:28:26
问题 When placing the legend outside of the axes using bbox_to_anchor as in this answer, the space between the axes and the legend changes when the figure is resized. For static exported plots this is fine; you can simply tweak the numbers until you get it right. But for interactive plots that you might want to resize, this is a problem. As can be seen in this example: import numpy as np from matplotlib import pyplot as plt x = np.arange(5) y = np.random.randn(5) fig, ax = plt.subplots(tight

Difference in legend position between ggplot and ggplotly?

余生长醉 提交于 2019-12-24 11:14:20
问题 I find out an interesting and strange difference between the same chart in ggplot and ggplotly income_gap_chart <- ggplot(income_gap, aes(x = Country, y = Percent, fill = Income)) + geom_bar(position = "dodge", stat = "identity") + scale_fill_brewer(palette = "Set1") + coord_flip() + theme(axis.title.y = element_blank()) + scale_y_continuous(limits = c(0, 100)) + theme_tufte() + theme(axis.title.y = element_blank()) + theme(legend.position = "bottom") For ggplot it looks perfect with a legend

How to create an ax.legend() method for contourf plots that doesn't require passing of legend handles from a user?

偶尔善良 提交于 2019-12-24 10:48:42
问题 Desired feature I would like to be able to call ax.legend() on an axis containing a contourf plot and automatically get the legend (see plot below for an example). More Detail I know how to create legend entries for contourf plots using proxies, see code below and which is already discussed in this Q&A. However, I would be interested in a solution where the final call to axes[0][-1].legend() does not require any handles being passed. The plot generation (more complex plots than in this

How do i make a color spectrum legend which represents my z values?

狂风中的少年 提交于 2019-12-24 09:52:22
问题 I have managed to use the grey scale command to make a 3D scatter plot with the third dimension representing a color gradient. I have hit a wall when trying to produce the legend that coincides with it though. I already have the range of colors I want I just dont know how to tell R to make them into a legend. Here is my code. conocarp.stands<-c(264,330,400,594,600,700,726,730,800,825,825,826,1914,2145,2200,2310,2475,2640,3630,3960,3960,4124,4554,5082,8250,8475,9200,1000) fimb.size<-c(540,2160

R: Legend color according to factor levels

女生的网名这么多〃 提交于 2019-12-24 08:13:22
问题 Inspired by this question where apparently the top answer is using an unsafe/erroneous way to add colors to a legend for a scatter plot. Top answer suggests doing this: data<-iris plot(data$Sepal.Length, data$Sepal.Width, col=data$Species) legend(7,4.3,unique(data$Species),col=1:length(data$Species),pch=1) Comments suggest using levels() instead of unique() for controlling the text and colors in the call to legend() , but are unclear on why it would help. I would need a better explanation to

insert graph legend using ggplot [duplicate]

一世执手 提交于 2019-12-24 07:36:46
问题 This question already has answers here : Add legend to ggplot2 line plot (3 answers) Closed 5 years ago . I have a question regarding the use of ggplot. I have the following data.frame, and a constant. I'm using the following function and I managed to make my plot but I can not print the legend, what am I doing wrong? this function would I use to get the plot: LINER_GRAPH_POWER_LIST_VALUES<-function(DF_N_EPC_AND_FOUND_EPC, DF_READ_EXTERNAL_LIST_EPC_TAGS ){ require(ggplot2) ggplot(DF_N_EPC_AND

How do I get series data to display in bar chart legend

十年热恋 提交于 2019-12-24 06:44:50
问题 I have a Windows Forms Application that displays a graph from data stored in a database. I am able to get the data to display in a bar graph or pie graph. But the legend in the bar graph only displays "Series1", the name of the series. The legend of the pie chart displays a correct legend with the series data. I've searched MSDN and found several articles on adding a legend but they all have the same results. Here is my bar chart code: string[] xvals = new string[dt.Rows.Count]; int[] yvals =