All Questions
Tagged with legend legend-properties
253
questions
1
vote
1
answer
37
views
How to change legend key shape for ggtree [closed]
I am working with a ggtree plot. The data used is available here.
Load required packages
#load libraries
pacman::p_load(
here,
dplyr,
googlesheets4,
...
0
votes
0
answers
29
views
How to plot the legend with combined_plot (ggplot2)
I created this script to display some environmental impacts for my research.
`legend_plot <- ggplot(data_longGW, aes(x = Crop_cycleGW, y = kg_CO2_eq, fill = Category)) +
geom_bar(stat = "...
1
vote
1
answer
29
views
Showing or saving only the legend of a plotly figure
Given a plotly figure with traces and a legend, is there a way to only show the legend without any of the plot content?
My use case for this: I'm exporting several images with the same legend. Instead ...
0
votes
0
answers
13
views
Matplotlib not changing legend labels for a plot in python package pyAT
So I am attempting to use a python interface of Accelerator Toolbox (pyAT: link here) to simulate the path of a few particles through an energy spectrometer. From this interface, I've utilized a ...
0
votes
0
answers
28
views
ggplot legend in R not recognising aesthetic changes for label category with no data points
Consider the following image:
Although the underlying dataset does not contain values below 0.1 degrees Celsius, I want to and still can force the legend to display the label and box for 'Below 0.1', ...
0
votes
1
answer
56
views
Force keys size to be smaller in multiple lines legend in ggplot
Is there any way to force legend key sizes to be independent from line height when we have legend text with multiple lines? I tried legend.key.height, ggtext::element_textbox_simple, and guides but ...
0
votes
2
answers
61
views
legend in bokeh UMAP shows only one entry
Hi there I just managed to get this plot done in bokeh, so I imagine there are many things that could be improved. Nonetheless, what bothers me the most is that I cannot figure out how to have all ...
1
vote
1
answer
80
views
plotly title_side position not working properly
I'm greenhand with Python plots but I was trying to do a PCA for different human populations; while I'm still working on the actual data, the main issue I'm having with visualizations in Python, as ...
0
votes
1
answer
258
views
ChartJS Customised tooltip and LegendText not displaying after version update
Earlier i was using 2.7.2 version of ChartJS, now im updating to 4.4.1
So in my chart i was creating customized tooltip and customized Legend text but after version update both are not working
Here is ...
-1
votes
2
answers
1k
views
How to put legend outside the plot for a for 2 column plot definition? [duplicate]
I am trying to plot the legend outside a 2 columns 5 rows, but in this MWE 2 rows example in matplotlib. Turns out the legend to "lower center" puts the space between the two plots as well, ...
1
vote
1
answer
228
views
How to customize the handles and labels for a legend
I am trying to customize the ax from matplotlib plot. Here I am using a surpyval package to fit the data and then plot it. The plot method in surpyval package does not accept arguments other than the ...
0
votes
1
answer
83
views
Separate out overlapping legend items ggplot()
The Issue
I have a plot that has various lines and symbols. They are all coloured by location ID. This has resulted in the legend items overlapping.
i.e.
There are four symbols: circle, triangle, ...
0
votes
1
answer
517
views
Using ggpattern with white pattern; fill and pattern different variables: How do I add a grey background to the pattern legend?
I am working on a graph and am using color and pattern for two different variables. I want the graph to have colored designs created by using a white pattern over the colored fills. (I tried making ...
0
votes
0
answers
75
views
How do I extract the shape of scatterplot legend entries?
I am trying to make a seaborn scatterplot with legend entries that combine color and shape. Rather than extract color and assign that to the shape entries like here, I want to extract the shape ...
1
vote
1
answer
196
views
get legend labels (text) from ggplot
I am trying to extract the label text from a ggplot legend object, e.g. for this plot:
library(ggplot2)
(p <- ggplot(mtcars, aes(x=mpg, y=disp, color=as.character(cyl))) + geom_point())
I can ...
1
vote
1
answer
36
views
How can I match the colors of lines and legend entries in ggplot2?
I have a dataframe of some spectra (one x-value, several y-values) and want to plot them in one graph. For this purpose, I want to use ggplot. After some research, I found a way to do so, but I want ...
0
votes
0
answers
283
views
How to deal with long legend labels when using multiple columns
It is necessary that the legend element can occupy several columns so that the legend does not stretch. It should work at any ncol value.
If you increase the length of the word "Some Line", ...
0
votes
1
answer
76
views
Related to legends for subplots in plotly
I have created the 4 subplots with the legends showing on right sideWhen I create subplots in plotly , legends are created either in right side or in the bottom of all subplots. But how can I get ...
0
votes
1
answer
212
views
How can I create a custom arrow-shaped legend key
I'm creating a plot using Matplotlib. I want the legend keys (the shapes next to the descriptive text in the legend) to be arrows similar to the ones present in the figure. I've been able to get an ...
3
votes
2
answers
273
views
Increase spacing between legend groups with patchwork settings
UPDATE:
The suggested code here
p1 + p2 + p3 + plot_layout(ncol = 1) +
plot_annotation(tag_levels = 'a') &
theme(legend.justification = "left")
returned this
I need to have the ...
0
votes
1
answer
80
views
Amchart 4 Legend In Arabic not Showing Properly
I want To start the Legend marker from the right side I already used these three Properties.
chart.legend.reverseOrder = true;
chart.legend.itemContainers.template.reverseOrder = true;chart.rtl = true;...
0
votes
0
answers
34
views
EXTJS Piecharts are not showing legend for dynamic data
Hello I have 2 pie charts one with static data and one with dynamic. The static piechart shows the legend however the dynamic one doesnt. Its the same code for both one. Both have the same fields from ...
1
vote
3
answers
160
views
Changing legend symbols in ggplot2
I have this plot made in ggplot2
With the following code:
colors4 <- c("Exp" = "#000000", "TL 1" = "#56B4E9", "TL 2"="#CC79A7", "TL ...
0
votes
1
answer
259
views
R survminer::ggsurvplot duplicates legend when setting linetype
Reproducible example:
require(Survival)
require(survminer)
require(ggplot2)
set.seed(42)
a <- c(32,291,545, 44,3,792,352, 20,615,169, 61,156, 88,863,255, 33,132,5,
63,8,964,831, 55,133, 12,...
0
votes
1
answer
291
views
Problem with handling multiple legends in subplots when you use plt.twinx()
I'm struggling to pass the list of my subplots with different scales on sides using plt.twinx() in each subplot to show all labels in a single legend box, but I get the following error:
...
0
votes
1
answer
332
views
How to avoid data disappearing from graph when click on the legend - React ECharts
I am trying to avoid the default click behavior on the legend of React ECharts.
When the user click on any legend item, the corresponding plotted data disappear
from the graph until the user click on ...
0
votes
1
answer
175
views
Adjust spacing between 2 markers of same line displayed in the legend of matplotlib plot
I am plotting 2 markers of the same line using the following code and
I want to adjust the spacing between two markers in the legend.
Code : ref.
import matplotlib.pyplot as plt
from matplotlib....
0
votes
1
answer
60
views
Only one legends shows up: multiple legends in ggplot with different data types
I am trying to make a boxplot of 2 different beta coefficients (returned from a model) from two groups of categories and I want to overlay the "true parameterized" beta coefficient on top of ...
0
votes
1
answer
38
views
R ggplot mixed legend of two legends
Here is the graph that I have as a basis:
color_two_groups_type_2 <- c("dark red", "black")
pd <- position_dodge(0.4)
hedonic_price_indices %>% ggplot(aes(x=year, y=index,...
1
vote
0
answers
201
views
Make legend horizontal and reduce the size in Plotly Dash
I am trying to make the attached legend horizontal and smaller in size but it's not working. Also if you see the Plot is hidden below the legend. (Some states are not visible) How can I set that to ...