labels

Bubble chart label placement algorithm? (preferably in JavaScript)

不羁的心 提交于 2019-12-03 02:18:23
问题 I'd like to automatically place 100-200 bubble labels so that the following requirements are met: Labels should not overlap Labels should preferably not overlap bubbles Label should be close to bubble Preferred label position (top left, top, bottom, right etc.) should be respected to some extent Font-size can vary Are there any helpful libraries / algorithms for this? (preferably JavaScript or PHP) (The label placement in the image does not meet these requirements) 回答1: This can be formulated

Adding text labels to ggplot2 scatterplot

耗尽温柔 提交于 2019-12-02 22:24:07
Is there a good way easy way to add text labels to the circles on the graph? I haven't able to do it using the directlabels package because I get the error: Error in direct.label.ggplot(p, "first.qp") : Need colour aesthetic to infer default direct labels." Here is the graph: And here is the code that I've been using: library(ggplot2) library(directlabels) #my data set: oc <- read.csv("http://www.columbia.edu/~mad2200/oc.csv") oc$percent_women <- oc$W_employment/(oc$M_employment+oc$W_employment) oc$size <- oc$W_employment+oc$M_employment p <- ggplot(oc, aes(M_w_earnings, W_w_earnings, label =

How to adjust the size of y axis labels only in R?

烈酒焚心 提交于 2019-12-02 21:41:43
How can I adjust only the size of Y-axis labels in R? I know that cex.axis alters the size of the axis labels but it only affects the x-axis. Why, and how can I adjust the y axis? ucfagls is right, providing you use the plot() command. If not, please give us more detail. In any case, you can control every axis seperately by using the axis() command and the xaxt / yaxt options in plot() . Using the data of ucfagls, this becomes : plot(Y ~ X, data=foo,yaxt="n") axis(2,cex.axis=2) the option yaxt="n" is necessary to avoid that the plot command plots the y-axis without changing. For the x-axis,

Using Stata Variable Labels in R

百般思念 提交于 2019-12-02 19:18:21
I have a bunch of Stata .dta files that I would like to use in R. My problem is that the variable names are not helpful to me as they are like "q0100," "q0565," "q0500," and "q0202." However, they are labelled like "psu," "number of pregnant," "head of household," and "waypoint." I would like to be able to grab the labels ("psu," "waypoint," etc. . .) and use them as my variable/column names as those will be easier for me to work with. Is there a way to do this, either preferably in R, or through Stata itself? I know of read.dta in library(foreign) but don't know if it can convert the labels

matplotlib matshow labels

扶醉桌前 提交于 2019-12-02 16:44:09
I start using matplotlib a month ago, so I'm still learning. I'm trying to do a heatmap with matshow. My code is the following: data = numpy.array(a).reshape(4, 4) cax = ax.matshow(data, interpolation='nearest', cmap=cm.get_cmap('PuBu'), norm=LogNorm()) cbar = fig.colorbar(cax) ax.set_xticklabels(alpha) ax.set_yticklabels(alpha) where alpha is a model from django with 4fields: 'ABC', 'DEF', 'GHI', 'JKL' the thing is that I don't know why, the label 'ABC' doesn't appear, leaving the last cell without label. If someone would have a clue how to modify my script in a way to appear the 'ABC' I

How do you replace a label in Tkinter python?

心不动则不痛 提交于 2019-12-02 11:55:37
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") #*************************************GBP*************************************# def rate(): rate = 1 if var.get() =='GBP' and var2

Tkinter function print in GUI

雨燕双飞 提交于 2019-12-02 04:12:14
问题 I have done a program with 2 apis that show forecast and city info of diffrent citys that the user choose. But now I need help cause Im stuck on how to get my make_request, make_requests and city_data to print the info in the GUI! I think I need a Label but I dont know how to do it, any tips/help would be great! Thanks: from tkinter import * import requests import json class Application(Frame): def __init__(self, master=None): Frame.__init__(self, master) self.root = master self.pack() self

Label in cfinput is displaying to the right of the text box

不打扰是莪最后的温柔 提交于 2019-12-01 17:18:11
When working with Coldfusion 9 and cfform with a HTML format, I place a cfinput on a page with a label, it displays the label to the right of the text box. I have tried using the tag, with and without it but no matter what I do, the label is always to the right of the box. <cfform method="post" name="mfForm" > <label for="campaign">Mailfile ID:</label> <cfinput type="text" name="campaign" id="campaign"> <cfinput type="submit" name="submit" value="Submit" id="submit"> </cfform> Don't ever remember having this problem before recently. I would just use an HTML form, but want to take advantage of

Label in cfinput is displaying to the right of the text box

烈酒焚心 提交于 2019-12-01 17:09:58
问题 When working with Coldfusion 9 and cfform with a HTML format, I place a cfinput on a page with a label, it displays the label to the right of the text box. I have tried using the tag, with and without it but no matter what I do, the label is always to the right of the box. <cfform method="post" name="mfForm" > <label for="campaign">Mailfile ID:</label> <cfinput type="text" name="campaign" id="campaign"> <cfinput type="submit" name="submit" value="Submit" id="submit"> </cfform> Don't ever

How to have axis labels in R corrgram?

﹥>﹥吖頭↗ 提交于 2019-12-01 11:12:16
I would like to have horizontal and vertical labels on x-axis and y-axis, see the following pseudocode. Henrik's comment of the related thread 2013 is about turning off diagonal labels and then trying to associate labels for the axes, but I do not want to turn off the diagonal labels You may turn the diagonal labels off by setting labels = NULL. Then you can try to add your labels where you wish by using text library("corrgram") ids <- c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18) # https://cran.r-project.org/web/packages/corrgram/vignettes/corrgram_examples.html corrgram(baseball,main=