labels

D3 update on node removal always remove the last entry in SVG DOM

对着背影说爱祢 提交于 2019-12-05 08:41:20
I'm seeing a weird behaviour in my D3 application and after hours of trying to figure out what's happening I hope someone can point me at the thing I obviously do wrong. I have simplified the app down to be very simple and still exhibit the problem. As you'll see it's derived from all the great D3 examples out there. The simple scenario I have an issue with is: select a node (by clicking on it) and, upon hitting the delete key remove said node along with all related links and labels of both the node and the links. The code pasted below is nearly there since it decreases the number of Nodes and

ggplot donut chart percentage labels

核能气质少年 提交于 2019-12-05 07:44:55
I'm trying to add percentage labels to a donut chart but have been unsuccessful in plotting a clear representation of percentage values (rounded and not overlapping) ## my data library(ggplot2) col <- c("white", "black", "transparent", "grey", "blue", "yellow", "green", "red", "pink", "orange", "brown") freq <- c(101, 68, 34, 18, 14, 5, 5, 3, 2, 1, 1) ## create data frame colour.df <- data.frame(col, freq) colour.df ## calculate percentage colour.df$percentage = colour.df$freq / sum(colour.df$freq)* 100 colour.df = colour.df[rev(order(colour.df$percentage)), ] colour.df$ymax = cumsum(colour.df

Justify individual axis labels in bold using ggplot2

◇◆丶佛笑我妖孽 提交于 2019-12-05 06:30:07
Question adapted from this question and solution: Highlighting individual axis labels in bold using ggplot2 I would like to selectively justify the horizontal axes labels depending on meeting a criteria. So borrowing from the above question and answer I've set up an example: require(ggplot2) require(dplyr) set.seed(36) xx<-data.frame(YEAR=rep(c("X", "Y"), each=20), CLONE=rep(c("A", "B", "C", "D", "E"), each=4, 2), TREAT=rep(c("T1", "T2", "T3", "C"), 10), VALUE=sample(c(1:10), 40, replace=T)) # Simple plot with factors on y axis ggplot(xx, aes(x = VALUE, y=CLONE, fill=YEAR)) + geom_bar(stat=

How do you fix? formtastic :label_method is no longer available

女生的网名这么多〃 提交于 2019-12-05 04:21:49
Ok.. I'm new to ruby/rails. So to compensate for my weakness, my company had a guy come in to help me create the bones of our website. He put in formtastic :label_method, so we could change what fields are displayed in the DDLB. When I moved my project to a new box, I got this error. :label_method is no longer available What I'm wondering is.. what do I use in it's place? Xaca Xulu I think it might be: :member_label According to http://rubydoc.info/gems/formtastic/2.0.0/Formtastic/Helpers/InputHelper "(Symbol, Proc, Method) — Deprecated, renamed to :member_label" If that doesn't work could you

Axis label hidden by axis in plot?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 00:47:40
I am trying to make a polar 'sypder' plot but I am having some problems with the axis labels. The xaxis tick lables always seem to end up on a layer below the y axis grid (the letters are covered by the grid line, as shown in the figure below), I would like them on top. I tried setting the zorders but with no success. If I set the zorder of the plotted lines above 2 they do go on top (in terms of layer) of the axis and grid... but I still want the labels to be visible on top of the plot. If I set them below 2 the lines go below the grid. Setting the zorder of the grid or the ticks labels does

Factorize a numeric variable with Greek expression in labels in R

99封情书 提交于 2019-12-04 19:16:51
Suppose the following data frame, I want to factorized var, and label numbers to Greek letters, from 1 to alpha, 2 to beta, 3 to gamma. But the following code does not work. var<-c(1,1,2,2,3,3) df<-as.data.frame(var) df$var<-factor(df$var, levels=c(1,2,3), labels=c("1"=expression(alpha), "2"=expression(beta), "3"=expression(gamma))) Why the final data frame is not greek letters but just text expressions? Can anyone help me on this? Thanks a lot. Does your locale support these characters? Does '\u03b1' print an alpha character? If not, you'll need to change your encoding. E.g., Sys.setlocale(

How do you replace a label in Tkinter python?

时光总嘲笑我的痴心妄想 提交于 2019-12-04 07:05:54
问题 I am a newbie programmer and I am making a currency converter....It is still in progress, but could anyone help me to try to replace the label made in 'def convert()'...To be clear, right now everytime I convert, a new label pops up underneath, but what I want to happen is that my label gets replaced everytime I click convert... import sys from Tkinter import * root = Tk() root.title("CURRENCY CONVERTER") root.geometry('600x300+30+100') root.config(bg="#000000") #*****************************

How to show marker labels permanently?

梦想的初衷 提交于 2019-12-04 06:00:15
问题 In jVectorMap, I tried to find a solution to show the marker labels permanently, but I couldn't make it. I also didn't find anything about it in the documentation. I just want the marker labels initially shown. Any suggestions? 回答1: There isn't a quick or simple one. The way jVectorMap displays labels is by using a div and a label property/object for the map object, which changes its position and text. If you want static permanent labels you'll have to construct and position and show them

Custom ggplot2 axis and label formatting

让人想犯罪 __ 提交于 2019-12-04 01:17:40
I'm trying to draw labels which look informative, clear and tidy. I was following example and raised one more question about label and axis formatting. For example, I have sales data which includes Brand, Categories and Expenditure in EUR. When sum of EUR is big (millions or more) labels look really hard to read and not informative. As a result, x-axis is in Scientific notation and also looks really uncleanly. I've manage to format labels in custom way: it shows Eur in thousands. geom_text(aes(label= paste(round(EUR/1000,0),"€"), y=pos), colour="white") Is there an easier or automated way? As

How to change the labels to the image (icon) in bar chart.js

给你一囗甜甜゛ 提交于 2019-12-03 21:27:50
问题 Help me, please. How to change the labels to the image (icon) in bar chart.js ? I mean, change from this change labels: "LifeWall_files/logo.png","Bodily Functions","Sleep" to this bottom icons 回答1: The easiest way to do this would be to get a font that includes these icons and then set the font family for the ticks ... options: { scales: { xAxes: [{ ticks: { fontFamily: 'FontAwesome' } }] } } }; and then specify the appropriate character codes in your labels labels: ["\uf24e", "\uf1b9", "