FAQ Database Discussion Community


Include formatted subscript in mtext?

r,axis-labels,subscript
Admittedly I am new to R but I have looked around quite a bit and I can't seem to solve this. For superscript this works lovely mtext(expression(paste( italic("h") ^ italic("2"))), side=2, line = 2, cex=cexm) but when I try to get a subscript using the same approach mtext(expression(paste(italic("I") [] italic("a"))),side=2,...

How do I change the format of the axis label in matplotlib

matplotlib,axis-labels
If I plot a log scale graph, matplotlib gives me the nice looking entries 105, 106, ... For readability I would however prefer the form 1e5, 1e6, ... Can I directly set the axis properties to behave that way? I rather ugly hack would be: import matplotlib.pyplot as plt import...

d3 show labels only for ticks with data in a bar chart

d3.js,axis-labels
First, I'm new with D3. :) I have a stacked bar chart. My y axis is a ordinal scale (state). In my data, I could have total=0 for some ticks. So, I just want to see the labels when the total > 0 but maintain all the ticks of the...

How to label an axis with several variables in R ggplot2

r,ggplot2,axis-labels
I have a dataframe as follows: Name,Tutor,Test,Score,Percent,school.year Mark,Eric,Maths,100,100,2 Mark,Eric,English,91,91,2 Sue,Richard,Maths,88,100,5 Sue,Richard,English,71,80.7,5 I would like to plot percent on the y axis and name on the x axis with bars for each test. My code does the plot how I would like but the x-axis label is just the name. I...

How to display specific years only on xAxis in a column-graph with Highcharts

highcharts,axis-labels,column-chart
Having trouble to display only the two selected years in my column chart. It always adds other years to it and the chart looks terrible. It should display "2007" and "2010", but shows "2006", "2008" and "2010". I guess it's a small thing to change, but I can't figure out...

Set Python to custom-set y-axis minor tick mark frequency

python-2.7,matplotlib,axis-labels
This question is related to plotting minor tick mars on the y-axis in a Python plot with matplotlib. Here is the code that I have: import matplotlib.pyplot as plt from matplotlib.ticker import MultipleLocator fig, ax = plt.subplots() fig.set_facecolor('white') x = [1,2,3] plt.subplot(211) plt.plot([1,2,3], label="test1") plt.plot([3,2,1], label="test2") plt.xticks() plt.yticks() ax.yaxis.set_minor_locator(MultipleLocator(5)) plt.show()...

how to subscript the x axis tick label

r,ggplot2,axis-labels
I generated this graph with the below script. But how could I subscript the "10" in PM10, "2" in SO2, and"2" in NO2? I tried levels(df$variable) <- c("PM[10]","SO[2]", "NO", "NO[2]"), but does not work. Can anyone help? Thank you! variable <- c("PM10","SO2","NO","NO2") coef <- c(10,20,30,40) coef_lb <- c(-5,10,23,27) coef_ub <-...

Order labels of x axis in ggplot2 following numerical values [duplicate]

r,ggplot2,axis-labels
This question already has an answer here: ggplot2: sorting a plot 4 answers The problem I am having is that ggplot2 is taking the labels of my factor variable and ordering them alphabetically: instead of the regular 1,2,3,...,19,20 it goes 1,10,11,...,8,9. Those labels values are numerically sorted, so I...

How to adjust the y-axis of bar plot in R using only the barplot function

r,plot,bar-chart,axis-labels
Using this example: x<-mtcars; barplot(x$mpg); you get a graph that is a lot of barplots from (0 - 30). My question is how can you adjust it so that the y axis is (10-30) with a split at the bottom indicating that there was data below the cut off? Specifically,...

Chart - Controlling axis interval, spacing and visibility

c#,charts,axis-labels
Using chart windows forms control to display: STACKED COLUMN Several series, ~70 datapoints per series. Let's say x: 0 - 70. Secondary Y-axis. POINT/LINE 0-3 series displayed, ~20 datapoints per series. X-values are 0-20, so only covering part of the chartarea. Primary Y-axis. I am adding custom labels to the...

Matplotlib/Pyplot shared axis for odd number of subplots

python,matplotlib,axis-labels,subplot
I am using the following code to produce an odd number of plots that I want 'butted' together and sharing axes. import matplotlib.pyplot as plt fig = plt.figure() ax1 = fig.add_subplot(4,2,1) ax1.set_yscale('log') ax1.set_xscale('log') plt.subplot(4,2,2, sharex=ax1, sharey=ax1) plt.subplot(4,2,3, sharex=ax1, sharey=ax1) plt.subplot(4,2,4, sharex=ax1, sharey=ax1) plt.subplot(4,2,5, sharex=ax1, sharey=ax1) plt.subplot(4,2,6, sharex=ax1, sharey=ax1) plt.subplot(4,2,7, sharex=ax1,...

Removing negative values from axis

java,javafx-8,bar-chart,linechart,axis-labels
I have a BarChart and a LineChart. The possible values go from negative(-) to positive(+). How would I only display the positive axis-labels? As in only remove the numbers. Should I make a custom Chart or is there an easier way?...

Making X-axis labels in R more granular

r,axis-labels,graphing
I'm producing a graph and R and would like the x axis to be more granular. Tenure Type Visits Members Percent 1 0 Basic 122446 283975 0.4311858 2 0 Premium 21190 44392 0.4773383 3 1 Basic 92233 283975 0.3247927 4 1 Premium 17909 44392 0.4034285 5 2 Basic 42516 283975...

Is there a way to detect zoom in Matplotlib plots and set minor tick format according to zoom level?

python,matplotlib,zoom,axis-labels
I want to plot a large data range but have ability to zoom in and gain resolution. I need to use custom major and minor tick formatting therefore I lose the ability to have them set dynamically with the zoom level. Is there a practical solution to this problem?

ggplot2: When overlapping two plots to get axes on the right, legend from second plot isn't displayed

r,plot,ggplot2,legend,axis-labels
I am using the ggplot_dual_axis() function from the Stack Overflow answer at How can I put a transformed scale on the right side of a ggplot2? in order to display two Y axes, one on the right and one on the left. The function is a big hacky mess that...

In R base plot, move axis label closer to axis

r,plot,axis-labels
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")...

R - change size of axis labels with ROCR

r,plot,axis-labels
I want to increase the size of the axis labels. The data contains ROC curves, drawn by ROCR. library(ROCR) # load the sample data and create an performance object data(ROCR.hiv) pp <- ROCR.hiv$hiv.svm$predictions ll <- ROCR.hiv$hiv.svm$labels par(mfrow=c(2,2)) pred<- prediction(pp, ll) perf <- performance(pred, measure="tpr", x.measure = "fpr") Some manipulations...

Manually scale discrete x axis variable in ggplot2

r,ggplot2,axis-labels
I have a ggplot2 plot where the x axis variable is a factor, but represents different time spans in months and years (1m, 3m, 6m, 1y, 2y, 3y, 5y, 7y, 10y, 20y, and 30y -- this is a yield curve). The factor variable gives me nice labels, but even spacing....

transitioning rotated axis labels with D3

d3.js,transition,axis-labels
I'm trying to create a graph that updates as new values are coming in. In order for the labels on the X axis to be readable I decided to rotate them slightly, so they don't overlap. When there's a new value, it's being drawn in the graph, then the path...

Format datetime axis in highcharts?

datetime,highcharts,formatting,axis-labels
http://jsfiddle.net/LLExL/4537/ Can anyone please help with this date time axis formatting on highcharts. I want Xaxis to show month only once unless the new month begins. Like 29 April 30 1 May 2 3 4 5 Any help would be highly appreciated ...

draw the y-label on the top of y axis

r,plot,axis-labels
I want draw the ylab on the top of the y axis, which code can I use? Here is the example par(mar=c(4,6,4,4)) plot(rnorm(100), ylab="") mtext(side=2, text="Label", las=1, line=2) I want draw the ylabel at the top of y axis which red arrow indicated. ...

JFreeChart axis label in Hours

java,jfreechart,axis-labels
I have data e.g. (1,3600), (2,4400), ... (33,15000) Where in (1,3000) -> 1 is a number -> 3600 is seconds If put in chart, the axis would show the "second" as number. I have set a code to show axis label in 1 hour interval. // Create an NumberAxis NumberAxis...

How to remove microseconds from matplotlib plot?

python,matplotlib,axis-labels
I have been through the pylab examples and many axis formatting questions, but am still unable to remove the microseconds from the x-axis in the plot below. Original code before trying to alter axis/tick properties and its output. #filenames to be read in file0 = 'results' #Get data from file...

How to deal with ggplot2 and overlapping labels on a discrete axis

r,plot,ggplot2,axis-labels
ggplot2 does not seem to have a built-in way of dealing with overplotting for text on scatter plots. However, I have a different situation where the labels are those on a discrete axis and I'm wondering if someone here has a better solution than what I've been doing. Some example...

Matlab Plot: adjust X-axis step sizes with different length and name them deferentially?

matlab,plot,matlab-figure,axis-labels
I am looking for some code for the following matlab plot, which now I adjust the X-axis step size manually. As can be seen, the step sizes of Axis are different. In the above case, I have like 600 data of 3 days, where about 100 data for Monday, 300...

Drawing the X and y axis for a curved Line in C# Form

c#,axis-labels
i i am relative new to c# and is trying to draw a curved line in c#. I would like to ask that is there any possible way to create an X and Y axis in order to show the coordinates of each point of the curved line. Please...