legend

matplotlib numbers in legend

时间秒杀一切 提交于 2019-12-12 13:06:10
问题 I have a couple of lines and I want to show a legend. The problem is, I can't use different styles ( -- , : , -. ) because there are too few of them, and I can't use markers ( + , * , etc.) because I need them to show some points on the lines. So the best idea I've come up with is to use numbers. But I can't figure how I can create legends with numbers. I can even draw numbers near lines myself (to place them in the best position), but how can I then draw a legend with the numbers? I.e.

Different scatterplot markers with the same label

孤街浪徒 提交于 2019-12-12 13:00:08
问题 I am having 'similar' issues to Matplotlib, legend with multiple different markers with one label. I was able to achieve the following thanks to this question Combine two Pyplot patches for legend. fig = pylab.figure() figlegend = pylab.figure(figsize=(3,2)) ax = fig.add_subplot(111) point1 = ax.scatter(range(3), range(1,4), 250, marker=ur'$\u2640$', label = 'S', edgecolor = 'green') point2 = ax.scatter(range(3), range(2,5), 250, marker=ur'$\u2640$', label = 'I', edgecolor = 'red') point3 =

text caption not appearing matplotlib

谁都会走 提交于 2019-12-12 12:13:23
问题 I cannot understand why my text caption does not appear on my plot. I am finding the documentation pretty confusing about the order of placement for the legend and caption labels.. My code is here, I don't know what is wrong. Everything is appearing as I would expect (title, axes labels, date format, ...) except the text for the caption is not on there at all. fig = plt.figure(figsize=(24, 12), dpi=60) ax = fig.add_subplot(111) plt.plot(datetime_series,ws_cumsum_mean1,label='1979-1994') plt

jfreechart - change sample of colors in legend

柔情痞子 提交于 2019-12-12 11:25:57
问题 Can someone tell me how to change samples of series color in legend in jfreechart. What I have now is small line of series color eg: I would like to have square sample of those colors. Here is an example Can someone help me? Ok I found the solution. At least I think. Of course there is no simple way to do this. There is now, you know, setShape(square) method, that will do the trick, at least i haven't found one. Basicly XY chart and time chart have "line style" legend by default in contrary

Chart.js HTML custom legend issues with doughnut chart

不羁的心 提交于 2019-12-12 11:25:12
问题 I'm working with chart.js and I followed this to create a custom HTML legend. The thing is, the hide/show functionality is not working. The first legend click hides the whole chart, while the others produce the error: Uncaught TypeError: Cannot read property '_meta' of undefined at t.getDatasetMeta (Chart.min.self-b26766dbef822c075056eb7012dc36ae75970dc990497732f927d46ef6070858.js:11) at HTMLLIElement.legendClickCallback (plot.self

how to place colorlegend (corrplot) in graphic

谁说胖子不能爱 提交于 2019-12-12 09:49:03
问题 I am using corrplot to create a correlation heatmap, but I don't like the default legend - it is too big. So I was trying to use the colorlegend() to add the legend after I create the plot (and disable the default legend with cl.pos="n" ). Only problem is that I can't figure out how to change the position of the legend - it ends up on the lower left. Ideally, I could place it on the top right, but I looked through the options for colorlegend and plot and can't figure this out. For example: #

matplotlib.pyplot scatterplot legend from color dictionary

眉间皱痕 提交于 2019-12-12 08:18:55
问题 I'm trying to make a legend with my D_id_color dictionary for my scatterplot. How can I create a legend based on these values with the actual color? #!/usr/bin/python import matplotlib.pyplot as plt from matplotlib import colors D_id_color = {'A': u'orchid', 'B': u'darkcyan', 'C': u'grey', 'D': u'dodgerblue', 'E': u'turquoise', 'F': u'darkviolet'} x_coordinates = [1,2,3,4,5] y_coordinates = [3,3,3,3,3] size_map = [50,100,200,400,800] color_map = [color for color in D_id_color.values()[:len(x

How to set the legend of color gradient in ggplot2 to a given value?

烂漫一生 提交于 2019-12-12 05:13:44
问题 I'm trying to do a bubble chart where the colors of the points are a gradient color depending on a value. The limit values I've set are 0.0001 to 0.1. The problem i have is that i want that the legend of color gradient have the same length from 0.0001 to 0.001, from 0.001 to 0.01, and from 0.01 to 0.1. The code I've wrote represents 0.5 in the middle of scale. I have this: x <- as.data.frame(cbind(c("rRNA modification","response to hydrogen peroxide","RNA processing","mRNA processing","rRNA

How to sort Legend of a chart in VBA

家住魔仙堡 提交于 2019-12-12 04:48:08
问题 I was trying to sort my legend and could not find any reliable answer. Here, Reordering Chart Data Series in Excel, you can find out how to do it manually. Also, a code was posted there, which was not working for me and it was too complicated for a task like this. Basically, we are trying to automate what is shown in the following picture. I am posting this to document my solution to this problem. Please propose your answers or look-up mine if you have the same question. 回答1: This code gets

Legends with multiple rows in Matlab

≡放荡痞女 提交于 2019-12-12 04:44:37
问题 How to create a legend with multiple rows or fit a legend within the plotting area. Following is my code and output plot figure; col = jet(numel(node_id_without_duplicates)); %legend('Node '); for i=1:numel(node_id_without_duplicates) specific_node = node_id_without_duplicates(i); legendInfo{i} = ['Node ', num2str(specific_node)]; MTBF_Specific_Node; //This is the call of an another tool created by me and not included in this example. end legend(legendInfo); 回答1: You can use gridLegend on FEX