legend Questions
2
Solved
This is similar to Matlab: Combine the legends of shaded error and solid line mean, except for Matplotlib. Example code:
import numpy as np
import matplotlib.pyplot as plt
x = np.array([0,1])
y =...
Freeholder asked 6/10, 2014 at 13:48
4
Solved
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() %>% addPr...
2
Solved
I want to move the legend title sex a little right to the horizontal center of legend box. I tried theme and guide_legend but failed. Both ways won't change the legend title position.
# example da...
2
Solved
for each subplot I have 3 seperate line:2017 ,2018 and 2019 with 3 times "go.Scatter", each subplot represents one country (25 countries) with always these 3 years. I can use the subplot ...
4
Solved
I've created this plot using Seaborn and a pandas dataframe (data):
My code:
import seaborn as sns
g = sns.lmplot('credibility', 'percentWatched', data=data, hue='millennial', markers=["+&qu...
Resurrection asked 19/7, 2017 at 21:41
7
Solved
I'm familiar with the following questions:
Matplotlib savefig with a legend outside the plot
How to put the legend out of the plot
It seems that the answers in these questions have the luxury of...
Salamander asked 11/4, 2012 at 7:32
4
Solved
I'd like to create a colorbar legend for a heatmap, such that the labels are in the center of each discrete color. Example borrowed from here:
import matplotlib.pyplot as plt
import numpy as np
fr...
Koons asked 9/4, 2013 at 17:20
2
Solved
Here is my code and the attached plot result:
g <-ggplot(NDVI2, aes(LAI2, NDVI, colour = Legend)) +
theme_bw (base_family = "Times") +
scale_colour_manual (values = c("purple&...
9
Is there a way to change the spacing between legend items in ggplot2? I currently have
legend.position ="top"
which automatically produces a horizontal legend. However, the spacing of the items...
4
Solved
I am producing some plots in matplotlib and would like to add explanatory text for some of the data. I want to have a string inside my legend as a separate legend item above the '0-10' item. Does a...
Taub asked 30/5, 2013 at 1:51
8
Solved
How can I can remove the letter 'a' from the legend generated by this code? If I remove the geom_text, then the 'a' letter will not show in the legend. I want to keep geom_text, though.
ggplot(data...
Offoffbroadway asked 20/8, 2013 at 14:29
3
Solved
I have an R Shiny app that uses Leaflet to create an interactive map. On this map, a categorical variable is used to designate different kinds of points and is visualized using custom markers (diff...
5
Solved
I can't seem to find the answer anywhere! I found a discussion here, but trying this I get a TypeError: 'NoneType' object is not iterable:
>>> import numpy as np
>>> import matpl...
Theine asked 7/5, 2012 at 23:3
2
Solved
I want to make my legend size bigger in Pyplot. I used this answer to do that. Here is my code.
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_style("whitegrid")
plt.rcPar...
Promulgate asked 29/11, 2022 at 1:33
6
Solved
I'm making some scatter plots and I want to set the size of the points in the legend to a fixed, equal value.
Right now I have this:
import matplotlib.pyplot as plt
import numpy as np
def rand_d...
Trophy asked 11/7, 2014 at 20:35
6
Solved
I currently am plotting a stacked bar graph of a large amount of taxonomic data, and only wish to show significant species in the legend (out of ~500 I wish to show ~25). Is there a simple way to d...
Thordia asked 10/7, 2014 at 15:50
9
Solved
I have the following data (temp.dat see end note for full data)
Year State Capex
1 2003 VIC 5.356415
2 2004 VIC 5.765232
3 2005 VIC 5.247276
4 2006 VIC 5.579882
5 2007 VIC 5.142464
...
and I ca...
6
Solved
I would like to make a legend entry in a matplotlib look something like this:
It has multiple colors for a given legend item. Code is shown below which outputs a red rectangle. I'm wondering wha...
Temple asked 9/8, 2015 at 21:23
2
Solved
I currently generate my legend with matplotlib this way:
if t==25:
l1,l2 = ax2.plot(x320,vTemp320,'or',x320,vAnaTemp320,'-r')
elif t==50:
l3,l4 = ax2.plot(x320,vTemp320,'ob',x320,vAnaTemp320,'-b'...
Caduceus asked 9/11, 2012 at 7:31
10
Solved
I have data that results in multiple lines being plotted, I want to give these lines a single label in my legend. I think this can be better demonstrated using the example below,
a = np.array([[ 3....
Slifka asked 13/10, 2014 at 10:10
4
Solved
I have a seaborn scatter plot (lmplot) with over 10K points. In order to perceive all the data, it works better when the plot size is larger (making the markers relatively small) and the alpha on t...
Culmiferous asked 8/2, 2018 at 20:54
7
Solved
How can one create a legend for a line graph in Matplotlib's PyPlot without creating any extra variables?
Please consider the graphing script below:
if __name__ == '__main__':
PyPlot.plot(length, ...
Friedlander asked 1/10, 2013 at 20:53
4
Solved
I have a matrix that I made an image of using image(matrix). Is there away to add a legend of the colors to my image like I do when adding a legend to plot?
5
Solved
I want to show the text for a line's label in the legend, but not a line too (As shown in the figure below):
I have tried to minimise the legend's line and label, and overwrite only the new-labe...
Degreeday asked 4/8, 2014 at 16:17
3
I'm trying to use Python and Matplotlib to plot a number of different data sets. I'm using twinx to have one data set plotted on the primary axis and another on the secondary axis. I would like to ...
Various asked 12/3, 2015 at 12:43
1 Next >
© 2022 - 2024 — McMap. All rights reserved.