legend

Adding legend to plot - d3

拥有回忆 提交于 2021-01-28 22:58:26
问题 After plotting a donut chart, I'm trying to add some legend, based on the following example: http://bl.ocks.org/ZJONSSON/3918369 However, I'm receiving this error: TypeError: undefined is not an object (evaluating 'n.apply') I've printed the return of line 131 and all the legend names are printed. I don't know what's is causing the undefined error print. This is my main code: var width = 300, height = 300, radius = Math.min(width, height) / 2; var color = d3.scale.ordinal() .range(colorrange)

Legend / scale with colour gradient start from certain value - define scale breaks

一个人想着一个人 提交于 2021-01-28 21:32:01
问题 I would like to get a customized legend for the ready heat map graph, so as it ranged from 0 to 1 with gray scale, but value before 0.01 remain white without any colour gradient on it. Managed to do it for the heat map graph but can't find any close example for the legend. Here is my code: > ggplot(heatmap,aes(Colour, Group, fill=p.value))+ + scale_fill_gradientn(colours= c("white","gray","black"), values=c(0,0.011,1), breaks=c(0,0.01,0.25,0.5,0.75,1), guide=guide_colorbar(frame.colour="black

Legend outside the plot

一笑奈何 提交于 2021-01-28 21:02:53
问题 do you know how can I put the Legend outside the plot area? (Both in code and in xaml) Thank you for your help! cis 回答1: There is no implementation in the current D3 library to move the legend outside the plotter. The most that can be done is to move the legend to a different place in the plotter by editing the Legend.xaml.cs file in the source code. You will have to change the dependency properties in the code-behind to move the legend around the area of your plotter. If you want to put your

Legend outside the plot

笑着哭i 提交于 2021-01-28 20:33:25
问题 do you know how can I put the Legend outside the plot area? (Both in code and in xaml) Thank you for your help! cis 回答1: There is no implementation in the current D3 library to move the legend outside the plotter. The most that can be done is to move the legend to a different place in the plotter by editing the Legend.xaml.cs file in the source code. You will have to change the dependency properties in the code-behind to move the legend around the area of your plotter. If you want to put your

Plotly subplots with shared legend in R

故事扮演 提交于 2021-01-28 09:02:03
问题 I have made twoplots using plotly, which are working fine individually, but when combined using subplot I can't seem to figure out how to combine the legends. I have tried to use showlegend = F in plot_ly in one of the plots, but this just removes it completely - what I want is to control both subplots with the same legend. My code is as follows: coronavirus_not_china <- coronavirus %>% filter(!(country == "China")) cases_not_china_plot <- coronavirus_not_china %>% group_by(type, date) %>%

common legend in arrange_ggsurvplots

一笑奈何 提交于 2021-01-28 07:44:09
问题 I'm trying to combine multiple survival plots, using arrange_ggsurvplots . Each plots was made by ggsurvplot function. Most of them works well. However, it is difficult to combine legends. let's take an example in survminer packages. https://rpkgs.datanovia.com/survminer/reference/arrange_ggsurvplots.html # Fit survival curves require("survival") fit<- survfit(Surv(time, status) ~ sex, data = lung) # List of ggsurvplots require("survminer") splots <- list() splots[[1]] <- ggsurvplot(fit, data

R - highcharter - selective legends at display

女生的网名这么多〃 提交于 2021-01-28 07:02:30
问题 I am not sure whether this could be done in highcharter, however, I have a scenario where I have 7 series plotted of which by default I need to display only 3, however remaining 4 should be greyed out but be present, user can click and select if needed. So, how can we do that? All suggestions are welcome. I did some research, however i was not able to get any leads. Thanks! hc <- highchart(type = "stock") %>% hc_title(text = paste0("<span style=\"color:#000000\">", prod_line, ", ", sku , " at

Amchart legend Margin between value and markers not working

泄露秘密 提交于 2021-01-28 06:50:45
问题 i have amcharts and i add legend to charts but show text value legend on marker i set margin left and right to legend value but not work chart.legend.valueLabels.template.marginRight=10; chart.legend.valueLabels.template.marginLeft=10; i will show legend like this 回答1: Make sure you have chart.rtl = true; set to enable support for Arabic. See amcharts.com/docs/v4/concepts/rtl for more details. 来源: https://stackoverflow.com/questions/56953963/amchart-legend-margin-between-value-and-markers-not

Small square instead of line in legend?

痞子三分冷 提交于 2021-01-28 04:34:07
问题 To make a custom legend, I currently use the following: handles, labels = plt.gca().get_legend_handles_labels() my_artist = plt.Line2D((0,1),(0,0), color = "blue", linestyle = "-", linewidth = 1) plt.legend([handle for i,handle in enumerate(handles) if i in display]+[my_artist], [label for i,label in enumerate(labels) if i in display]+["My legend"]) It will draw a blue line in the legend box. Instead of a line I would like to have a small blue square (but larger than a simple marker). How to

Small square instead of line in legend?

筅森魡賤 提交于 2021-01-28 04:25:17
问题 To make a custom legend, I currently use the following: handles, labels = plt.gca().get_legend_handles_labels() my_artist = plt.Line2D((0,1),(0,0), color = "blue", linestyle = "-", linewidth = 1) plt.legend([handle for i,handle in enumerate(handles) if i in display]+[my_artist], [label for i,label in enumerate(labels) if i in display]+["My legend"]) It will draw a blue line in the legend box. Instead of a line I would like to have a small blue square (but larger than a simple marker). How to