Questions tagged [legend-properties]

legend-properties refers to various chart libraries and the ability to programmatically customise legends in charts generated by those libraries.

legend-properties refers to various chart libraries and the ability to programmatically customise legends in charts generated by those libraries. Examples for proper use of the tag is :

413 questions
6
votes
1 answer

Remove space between name and percentage in pie chart legend (amcharts4)

I want to get rid of that space in the legend between the name and the percentage. In the pic, I have highlighted the space in yellow. For example, I want the first legend item to be "Lithuania (30.5%)". That extra space between "Lithuania" and…
Thanatos
  • 282
  • 5
  • 18
6
votes
1 answer

Plot issues - legend bar scale, breaks, legend, decimals

I want to plot a bunch of rasters and I created a code to adjust breaks for each one and plot them trough a for loop. But i'm getting a problematic color scale bar, and my efforts haven't being effective to solve that. Example: I have precipitation…
Thai
  • 493
  • 5
  • 15
6
votes
2 answers

Arguments of bbox_to_anchor() function

import matplotlib.pyplot as plt import numpy as np x = np.arange(10) fig = plt.figure() ax = plt.subplot(111) for i in xrange(5): ax.plot(x, i * x, label='$y = %ix$' % i) ax.legend(bbox_to_anchor=(1.1, 1.05)) plt.show() In the above code I…
Soumya
  • 87
  • 1
  • 2
  • 15
6
votes
1 answer

onClick event to Hide dataset Chart.js V2

How can I make a html legend from Chart.js to hide/show the dataset of the chart, like the legend generated by the Chart.js itself Legend on bottom -> Chart.js legend Legend on right-> HTML How can I click in "SETOR AGILIZA" and get the dataset…
dpanegassi
  • 649
  • 4
  • 8
  • 15
6
votes
1 answer

Printing too big legend box in RStudio

I am trying to add a legend to my plot and I don't understand why I can't control for its size and/or location. I know there is a lot of posts about it but I already tried to reproduce the solutions and for whatever reason it does not seem to work…
Justyna
  • 737
  • 2
  • 10
  • 25
5
votes
1 answer

How to change and/or separate components in a figure legend in r?

I've created the below figure in R to visualize my raw data and predictions from a model that I ran. Predictions are given as lines and raw data as circles. Data from 2018 are currently visualized as open circles or solid lines while 2019 data is…
ljh2001
  • 391
  • 3
  • 17
5
votes
2 answers

Spacing between the legend keys for multiple legends in ggplot2 in R

I searched through internet and I couldn't find a solution for my issue. So to make it more solid say that we have a graph with two legends like below: library(ggplot2) ggplot() + geom_point(data = mtcars, aes(x = disp, y = mpg, color = gear), …
DSA
  • 655
  • 5
  • 13
5
votes
2 answers

Custom legend labels - geopandas.plot()

A colleague and I have been trying to set custom legend labels, but so far have failed. Code and details below - any ideas much appreciated! Notebook: toy example uploaded here Goal: change default rate values used in the legend to corresponding…
claytonrsh
  • 208
  • 2
  • 9
5
votes
1 answer

Using different colors AND shapes in legend [Seaborn, Python]

I've read through examples on how to use different shapes and/or colors to separate data in a Seaborn plot. However, it seems that color and shapes are tied together, to show a separate variable. For instance, in the following script (borrowed from…
AaronJPung
  • 1,105
  • 1
  • 19
  • 35
5
votes
1 answer

How to increase marker size of the legend in scatter plot in MATLAB 2014b?

I found marker size in the scatter plot and the legend is different in MATLAB 2014b. I searched & found some solution from earlier version of MATLAB, which are not applicable in the latest version. In my current version, the marker size in legend is…
user962808
  • 115
  • 1
  • 2
  • 10
5
votes
1 answer

R Leaflet Legend: specify order instead of alphabetical

I added legend to r leaflet code and output is this I would like the order to be GREEN "More than 66%" ORANGE "Between 33% and 66%" RED "Less than 33%" Code sep <- read.csv("31R_SEP_assets_csv - Copy.csv") Sub1 <- sep[grep("SEP.12",…
Rhonda
  • 1,661
  • 5
  • 31
  • 65
5
votes
1 answer

Place MATLAB legend such that it does not overlap on the plot

I am generating multiple plots of different datasets in succession using MATLAB. I would like the legend positions to be such that they don't overlap on the plotted lines and it would be ideal if this placement could be done automatically. I am…
Slothworks
  • 1,083
  • 14
  • 18
5
votes
3 answers

R corrplot colorlegend change range

I am trying to plot in R a correlation matrix using the corrplot package. My problem is that the range of min and max correlation coefficients of the entire matrix is (-0.2,0.2). I plot the matrix with corrplot and I use a custom colorRampPalette,…
cristis
  • 77
  • 1
  • 6
5
votes
1 answer

Matplotlib legend: labels above markers

I have a plot with multiple lines, each labelled separately. I'd like to put a legend in the plot so that individual lines can be identified. The default ordering of labels and markers looks something like: marker : label marker : label marker :…
allhands
  • 345
  • 1
  • 4
  • 12
5
votes
2 answers

Legend does not show line type in ggplot2 density plot

I created a density plot with ggplot from a dataframe with 3 variables. One density line is dotted, but the legend shows a solid line for this line. The data looks like this: > head(df) R1 R2 R3 1 0.085383867 …
FreshF
  • 381
  • 1
  • 5
  • 13
1 2
3
27 28