axis-labels

mtext: smaller labels description when layout is used

爷,独闯天下 提交于 2019-12-08 03:52:48
问题 Using mtext for the label description does something different than using xlab. How can I make the mtext labels be always the same size as it would be when using xlab (without defining always the cex argument). In the minimal example below cex=cex.lab=1 for both figures. However the size is different. layout(matrix(c(1,1,2,2), ncol=1)) op<-par(mar=c(4,4,2,1)) plot(1:10, xlab="", ylab="", main="This is my title") mtext("this is the x-axis", side=1, line=2.75, cex=1) mtext("this is the y-axis",

R plot with strings showing in the axis

倖福魔咒の 提交于 2019-12-08 03:10:18
问题 I am plotting number of residents against the dorm room numbers (4 digits). The room numbers are supposed to be strings. But when I used as.character(RmNum), the axis still shows as numeric. meanResidents = c(3, 4, 3, 2, 4, 5) rmNumber = c(2034, 3043, 4012, 2035, 2022, 3013) plot(as.character(rmNumber), meanResidents, xlab = as.character(rmNumber)) I would want the dorm numbers showing vertically in the axis. Can someone help me with that? 回答1: With the function axis you can specify the

python matplolib polar chart x-axis label position

喜你入骨 提交于 2019-12-08 01:34:28
问题 I'm using (maybe misusing?) a Polar chart to represent some data I have. I would like to have the labels, currently positioned right above the x-axis, to be above the segment of data. So right between the axis. I've found multiple articles on how to rotate everything but it always keeps the label right above the axis. The peace of code I have for the axis (if you need the whole definition/code, please say so): # Set axis names and orientation ax.set_theta_zero_location("N") ax.set_xticklabels

D3 grouped bar chart: How to rotate the text of x axis ticks?

不打扰是莪最后的温柔 提交于 2019-12-07 03:16:54
问题 I'm using the Grouped Bar Chart(http://bl.ocks.org/mbostock/3887051), but the text of the x-axis is very long, as shown in attached picture. How to rotate the text? Thank you. 回答1: A reasonable solution can be found here The result looks like this: Make sure you fully understand this portion of code: svg.append("g") .attr("class", "x axis") .attr("transform", "translate(0," + height + ")") .call(xAxis) .selectAll("text") .style("text-anchor", "end") .attr("dx", "-.8em") .attr("dy", ".15em")

mtext: smaller labels description when layout is used

China☆狼群 提交于 2019-12-07 02:51:26
Using mtext for the label description does something different than using xlab. How can I make the mtext labels be always the same size as it would be when using xlab (without defining always the cex argument). In the minimal example below cex=cex.lab=1 for both figures. However the size is different. layout(matrix(c(1,1,2,2), ncol=1)) op<-par(mar=c(4,4,2,1)) plot(1:10, xlab="", ylab="", main="This is my title") mtext("this is the x-axis", side=1, line=2.75, cex=1) mtext("this is the y-axis", side=2, line=2.5, cex=1) plot(1:10, xlab="this is smaller", ylab="this is smaller", main="This is my

Use only custom label in X-axis in .NET chart

爷,独闯天下 提交于 2019-12-07 02:25:09
问题 I'm making a .NET line graph in C# with an X-axis interval of weeks. For my project, I only want to be using the custom label, but for now I still want the gridlines. Does anyone know a way to hide the default X-Axis labels while still keeping the custom labels? I tried this: Chart4.ChartAreas[0].AxisX.LabelStyle.Enabled = false; The obvious result is that there were no labels applied, which is not what I was trying to do. EDIT: The code for generating the original rows was this: Chart4

Setting x and y labels with holoviews

房东的猫 提交于 2019-12-07 01:40:50
问题 I would like to change the labels on the x and y axis on a figure from holoviews to be something other than the internal variable name. It seems the typical way to affect the axis labels is to change the variable names themselves to the label. This is rather inconvenient if you want complex labels, especially if you are frequently converting from other complex data objects like pandas dataframes. Is there a general way to either: (A) change x and y labels of a figure as or after you plot it

Coloring the axis tick text by multiple colors

你说的曾经没有我的故事 提交于 2019-12-06 14:54:26
I'm trying to plot a heatmap using R 's plotly package, where I'd like to have specific colors to specific labels of the y-axis tick text. Here's an example dataset: set.seed(1) df <- reshape2::melt(matrix(rnorm(100),10,10,dimnames = list(paste0("G",1:10),paste0("S",1:10)))) And here's what I'm trying: library(plotly) library(dplyr) plot_ly(z=c(df$value),x=df$Var2,y=df$Var1,colors=grDevices::colorRamp(c("darkblue","gray","darkred")),type="heatmap",colorbar=list(title="Scaled Value",len=0.4)) %>% layout(yaxis=list(title=list(color=c(rep("darkred",5),rep("darkblue",5))))) It's not working since

python matplolib polar chart x-axis label position

烈酒焚心 提交于 2019-12-06 11:29:20
I'm using (maybe misusing?) a Polar chart to represent some data I have. I would like to have the labels, currently positioned right above the x-axis, to be above the segment of data. So right between the axis. I've found multiple articles on how to rotate everything but it always keeps the label right above the axis. The peace of code I have for the axis (if you need the whole definition/code, please say so): # Set axis names and orientation ax.set_theta_zero_location("N") ax.set_xticklabels(['Seg 1', 'Seg 2', 'Seg 3', 'Seg 4', 'Seg 5', 'Seg 6', 'Seg 7', 'Seg 8']) ax.set_ylim((0, 10.0)) ax

Bokeh Plot with a nominal or ordinal axis type

♀尐吖头ヾ 提交于 2019-12-06 10:16:13
Edit: The code in the original question refers to a version of Bokeh that is years out of date. But the answer below has been updated to answer the same question for modern versions of Bokeh Bokeh Plot with a nominal axis type from bokeh.plotting import * from bokeh.objects import * output_notebook() label = ['United States', 'Russia', 'South Africa', 'Europe (average)', 'Canada', 'Austalia', 'Japan'] number = [1, 2, 3, 4, 5, 6, 7] value = [700, 530, 400, 150, 125, 125, 75] yr = Range1d(start=0, end=800) figure(y_range=yr) rect(number, [x/2 for x in value] , width=0.5, height=value, color = "