legend

R leaflet map - Change legends based on selected layer group

喜你入骨 提交于 2019-12-22 06:01:50
问题 I am making an R leaflet map (not Shiny) and I have two control groups, and based on the selection I would like a different legend to become visible. Currently I only manage to have both legends visible at all time. Below is the code for the leaflet map, and the output can be seen in the image. leaflet() %>% addSearchOSM() %>% addProviderTiles(providers$CartoDB.Positron, options = providerTileOptions(noWrap = TRUE), group = "kaart") %>% # addFullscreenControl() %>% addCircleMarkers(data =

R leaflet map - Change legends based on selected layer group

微笑、不失礼 提交于 2019-12-22 06:01:15
问题 I am making an R leaflet map (not Shiny) and I have two control groups, and based on the selection I would like a different legend to become visible. Currently I only manage to have both legends visible at all time. Below is the code for the leaflet map, and the output can be seen in the image. leaflet() %>% addSearchOSM() %>% addProviderTiles(providers$CartoDB.Positron, options = providerTileOptions(noWrap = TRUE), group = "kaart") %>% # addFullscreenControl() %>% addCircleMarkers(data =

reverse order in R leaflet continuous legend

若如初见. 提交于 2019-12-22 05:42:10
问题 I am trying to reverse the value display of my leaflet legend in R. This post covers categorical data, but I am working with continuous data. Here's a toy example: map <- leaflet() %>% addProviderTiles('Esri.WorldTopoMap') x <- 1:100 pal <- colorNumeric(c("#d7191c","#fdae61","#ffffbf","#abd9e9", "#2c7bb6"), x) map %>% addLegend('topright', pal=pal, values=x) I'd like the legend to read 100 at the top and 1 on the bottom with the colors reversed. I can certainly reverse the colors in

legend troubles in ggplot scatter plot

筅森魡賤 提交于 2019-12-22 05:33:38
问题 I want to use ggplot to create a scatter plots showing method comparison data. The plots should have the raw data, the ideal line, and the fitted line with error. The legend should show the linetype/linewidth/line color for the ideal and fitted lines. I can get most of what I want, but have these problems with the legend: the legend shows 2 lines for each line type, why?, how to fix? I'd prefer no pink background in the legend rectangles (if I don't specify the fill color then the

Highcharts - fire legendItemClick event

放肆的年华 提交于 2019-12-22 04:36:28
问题 I want to fire the same event that it's fired when you select an item legend but from an external html button. Is it possible? I've created a jsfiddle to show it: http://jsfiddle.net/YcJF8/1/ . $('#container').highcharts({ chart : { type : 'spline', }, xAxis : { categories : ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] }, series : [{ data : [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4], }], plotOptions : { series : {

How to wrap legend text in Chartjs?

落花浮王杯 提交于 2019-12-21 17:50:20
问题 My ChartJs legend text is overflowing in the same line when the text is too long. Is there any parameter that I can use to enable text-wrap. legend : { display : true, position : 'bottom', fullWidth: false, labels : { fontColor : "#000", // boxWidth : "3" } } In other chart libraries like highcharts, you just have to set width and the text will be wrapped if it exceeds the width. Is there such an option in ChartJS? Highcharts Library Example: legend: { itemStyle: { width: 90 // or whatever,

Improving D3 Sequence Sunburst Example

天大地大妈咪最大 提交于 2019-12-21 12:25:38
问题 This D3 example served as my starting point: http://bl.ocks.org/kerryrodden/7090426 I wanted to change data that feeds the diagram, and I made following new example : http://jsfiddle.net/ZGVK3/ One can notice at least two problems: Legend is wrong. This is because it still contains 'hardcoded' names from original example. All nodes are colored black. This is because the color scheme is also 'hardcoded' only for node names from original example. How to improve the original example (or my

How to add legend in imagesc plot in matlab

﹥>﹥吖頭↗ 提交于 2019-12-21 11:45:23
问题 I have the following code, creating figures which I print to files: f=figure; set(gcf,'Visible','off'); imagesc (exp_genes_sorted_cut); h=colorbar; set(gcf,'Colormap',mycmap); set(gca, 'xtick', 1:num_tissues_displayed); set(gca, 'xticklabel', tissues, 'fontsize', 14); ylabel('Genes', 'Fontsize', 18); xlabel('Tissues', 'Fontsize', 18); I want to add legend to the right of the colorbar, and I tried doing so using the legend function, but it is not shown... using the text function places it

How do I set label for an already plotted line in matplotlib?

混江龙づ霸主 提交于 2019-12-21 07:56:08
问题 In my code I've already executed ax.plot(x, y, 'b.-', ...) and need to be able to set the label for the corresponding line after the fact, to have the same effect as if I'd ax.plot(x, y, 'b.-', label='lbl', ...) Is there a way to do this in Matplotlib? 回答1: If you grab the line2D object when you create it, you can set the label using line.set_label() : line, = ax.plot(x, y, 'b.-', ...) line.set_label('line 1') If you don't, you can find the line2D from the Axes : ax.plot(x, y, 'b.-', ...) ax

Add legend outside of axes without rescaling in MATLAB

眉间皱痕 提交于 2019-12-21 07:11:53
问题 I've got a GUI in MATLAB with a set of axes pre-placed. I'm using the location property of the legend to place it to the right hand side of the axes. However, by doing this the axes get re-scaled so that the axes+legend take up the original width of the axes. Is there any way to circumvent the re-size? Example: x=0:.1:10; y=sin(x); figure pos=get(gca,'position'); pos(3)=.5; %#re-size axes to leave room for legend set(gca,'position',pos) plot(x,y) So far I get: Place legend: legend('sin(x)',