axis-labels

In R base plot, move axis label closer to axis

纵饮孤独 提交于 2019-12-03 04:22:05
I have eliminated labels on the y axis because only the relative amount is really important. w <- c(34170,24911,20323,14290,9605,7803,7113,6031,5140,4469) plot(1:length(w), w, type="b", xlab="Number of clusters", ylab="Within-cluster variance", main="K=5 eliminates most of the within-cluster variance", cex.main=1.5, cex.lab=1.2, font.main=20, yaxt='n',lab=c(length(w),5,7), # no ticks on y axis, all ticks on x family="Calibri Light") However, suppressing those tick labels leaves a lot of white space between the y axis label ("Within-cluster variance") and the y axis. Is there a way to nudge it

How can you create a box around an axis tick label in ggplot2?

泪湿孤枕 提交于 2019-12-03 01:50:33
For several reasons, I am trying to duplicate the grotesque plot shown below. It violates many precepts of good data visualization so for training purposes my goal is to use ggplot2 and deconstruct it -- remove or revise poorly-chosen features one at a time. Using the data reproduced at the bottom and the code below the plot, I am getting close but have been unable to figure out how to include one notable feature. Question: Is there a way to reproduce the black shaded rectangle around the three tick labels? (If so, it is straightforward to create another factor variable to identify those three

Move tick label JavaFx 2

早过忘川 提交于 2019-12-02 11:44:10
问题 Is it possible to move/shift the tick labels into the chart. Currently I see api's to hide/show tick labels is there an API that moves the tick labels inside the chart? If there isn't an API then is there a technique that I can use/apply to get this done? Current code public class Graph extends Application{ private NumberAxis xAxis; private NumberAxis yAxis; public static void main(final String[] args) { launch(args); } @Override public void start(final Stage primaryStage) throws Exception {

imshow: labels as any arbitrary function of the image indices

只谈情不闲聊 提交于 2019-12-02 09:12:42
问题 imshow plots a matrix against its column indices (x axis) and row indices (y axis). I would like the axes labels to not be indices, but an arbitrary function of the indices. e.g. pitch detection imshow(A, aspect='auto') where A.shape == (88200,8) in the x-axis, shows several ticks at about [11000, 22000, ..., 88000] in the y-axis, shows the frequency bin [0,1,2,3,4,5,6,7] What I want is: x-axis labeling are normalized from samples to seconds. For a 2 second audio at 44.1kHz sample rate, I

R: Boxplot - how to move the x-axis label down?

时光毁灭记忆、已成空白 提交于 2019-12-02 06:50:24
问题 #RGR ~ Treatment:Geno boxplot fit <- aov(Total.RGR~Treatment:Geno, data=For.R) summary(fit) t <- TukeyHSD(fit) t boxplot(Total.RGR~Treatment:Geno, data=For.R,las=2,ylim=c(-20,100),xlab="Treatment:Geno",ylab="RGR (mg/day)") text(1:8, 95 ,c("a","ac","a","a","a","bd","bcd","ad")) Is my code, it does the job, but when I rotate my x-axis labels the obstruct the x-axis title. Does any of you know of a way to move the title down? It must be easy but I cant find anything in the reference. Thanks.

Move tick label JavaFx 2

非 Y 不嫁゛ 提交于 2019-12-02 04:24:48
Is it possible to move/shift the tick labels into the chart. Currently I see api's to hide/show tick labels is there an API that moves the tick labels inside the chart? If there isn't an API then is there a technique that I can use/apply to get this done? Current code public class Graph extends Application{ private NumberAxis xAxis; private NumberAxis yAxis; public static void main(final String[] args) { launch(args); } @Override public void start(final Stage primaryStage) throws Exception { xAxis = new NumberAxis(0, 300, 20); xAxis.setAutoRanging(false); xAxis.setAnimated(false); xAxis

Removing gap between ggplot y-axis and first x-value

自闭症网瘾萝莉.ら 提交于 2019-12-02 04:09:21
问题 I need to remove the gap preceding 1950 on the x axis. I have attempted to use scale_x_continuous but this results in: Error: Discrete value supplied to continuous scale I believe this must have something to do with the date format of the data. Example Data: x y date 1 -631152000 -1.018 1950-01-01 01:32:40 2 -628473600 -1.143 1950-02-01 01:32:40 3 -626054400 -1.290 1950-03-01 01:32:40 4 -623376000 -1.061 1950-04-01 01:32:40 5 -620784000 -1.416 1950-05-01 01:32:40 6 -618105600 -1.372 1950-06

How to have a common label for all x and y axes in case of subplots?

纵然是瞬间 提交于 2019-12-02 03:52:27
I have used the following loop to get subplots: for j=1:19; Aj=B(j,:); subplot(5,4,j); plot(Aj,h) end For all these subplots, I need to have only one x-label and one y-label. How to do this? Also how to insert legend to all the subplots? You can use suplabel from the FileExchange to have combined x and y label for all subplots. Example: subplot(1,2,1); plot(randperm(40)); hold on; plot(randperm(40)); %Plotting some random data legend('show') %To show the legend subplot(1,2,2); plot(randperm(40)); hold on; plot(randperm(40)); %Plotting some random data legend('show') %To show the legend %Using

change y axis labels in nvd3 scatter-chart

╄→гoц情女王★ 提交于 2019-12-02 03:23:54
问题 I am trying to have my own y axis labels for the bubble chart in nvd3. Currently the labels are [1,2,3,4,5]. I want them to be displayed as [2,4,8,16,32]. I found the following function, chart.yAxis.tickValues(['2','4','8','16','32']); But the labels are not being changed here. I am unable to understand why. 回答1: These tick values will not have any effect if the y values themselves are not within the 2-32 range. Right now that chart only has y values up to 2+. So, if in addition to adding

Removing gap between ggplot y-axis and first x-value

南笙酒味 提交于 2019-12-02 02:23:58
I need to remove the gap preceding 1950 on the x axis. I have attempted to use scale_x_continuous but this results in: Error: Discrete value supplied to continuous scale I believe this must have something to do with the date format of the data. Example Data: x y date 1 -631152000 -1.018 1950-01-01 01:32:40 2 -628473600 -1.143 1950-02-01 01:32:40 3 -626054400 -1.290 1950-03-01 01:32:40 4 -623376000 -1.061 1950-04-01 01:32:40 5 -620784000 -1.416 1950-05-01 01:32:40 6 -618105600 -1.372 1950-06-01 01:32:40 7 -615513600 -1.334 1950-07-01 01:32:40 8 -612835200 -1.050 1950-08-01 01:32:40 9 -610156800