w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Changing Colors for a clustered bar graph based on axis label
the s.XValues(iPoint) will contain Title and Criticality concatenated. Try to change: If s.XValues(iPoint) = "avg" to: If right(s.XValues(iPoint), 9) = "Emergency" In this way you will check if the last 9 letters of the label are exactly "Emergency". You should be able to modify your code to add another condition for Critical or Warning. Hope this help, The Macro Guru

Categories : Excel

changing axis labels in excel 2007 charts using python win32com
You probably used the wrong enum axis type. Each enum (as far as I can tell) only works for certain types of charts. According to the built-in macro recorder (very useful even for python-based scripts, btw), scatter plots use xlValue, not xlCategory. Try one of the other enums until your code works. I haven't fully figured out Excel in win32com yet, but I managed to get axis titles to appear after a bit of trial and error. Here's a short snippet from some code I wrote for an XY scatter plot with titles for X axis, Y axis, and Y2 axis: Foo = chart.SeriesCollection(1) Bar = chart.SeriesCollection(2) Bar.AxisGroup = 2 Primary_Axis = chart.Axes(AxisGroup=xlPrimary) Foo_xAxis = Primary_Axis(1) Foo_yAxis = Primary_Axis(2) Foo_xAxis .HasTitle = True Foo_yAxis

Categories : Python

How can I set min/max of the x-axis in Rickshaw / D3?
I had the same issue and solved it by adding null data points with the desired minimum and maximum x-value: <div id="chart"></div> <div id="x_axis"></div> <script> var graph = new Rickshaw.Graph( { element: document.getElementById('chart'), width: 500, height: 200, renderer: 'line', series: [ { data: [ { x: -5, y: null}, { x: 10, y: null}, ] }, { color: 'steelblue', data: [ { x: 0, y: 40 }, { x: 1, y: 49 }, { x: 2, y: 38 }, { x: 3, y: 30 }, { x: 4, y: 32 } ] } ] }); var x_ticks = new Rickshaw.Graph.Axis.X({ graph: graph, orientati

Categories : Javascript

Can't display axis to my rickshaw chart
new Rickshaw.Graph.Ajax( { element: document.getElementById("chart"), width: 580, height: 300, renderer: 'line', dataURL: 'dataoutevo.json', onData: function(d) { d[0].data[0].y = 80; return d }, onComplete: function(transport) { // important . do not forget var graph = transport.graph; var detail = new Rickshaw.Graph.HoverDetail({ graph: graph }); var legend = new Rickshaw.Graph.Legend({graph: graph,element: document.querySelector('#legend')}); var xAxis = new Rickshaw.Graph.Axis.Time({graph: graph}); xAxis.render(); var yAxis = new Rickshaw.Graph.Axis.Y({graph: graph}); yAxis.render(); var shelving = new Rickshaw.Graph.Behavior.Series.Toggle({ graph: graph, legend: legend }); var high

Categories : Json

How to set y-axis to fixed range in rickshaw?
I have used Giraffe - https://github.com/kenhub/giraffe that extends/built on top of rickshaw. With that you can set a "min" and "max" for a chart to set the scale. Since Giraffe uses rickshaw underneath, there should be something similar on rickshaw.

Categories : Javascript

How to make the NVD3 discreteBarChart labels on the X axis to adapt to the width or to the number of labels?
Little late to answer, but to get similar results but using multi-barchart as mentioned by Lars , you can use following command to get a similar graph (i.e hide "stacked" and "grouped", as well as legend buttons). n1$chart(showControls = FALSE, showLegend = FALSE)

Categories : Javascript

Raphael Line Chart Axis labels overlapping with Axis lines
Not sure if you still need this... but I end up writing my own label function if (props.label !== undefined) { // don't use the default Raphael label() function, is broken chart.customLabel = customLabelFn; chart.customLabel(props.label); } Where customLabelFn is how i draw my labels, this is an example I have for my vertical bar chart: customLabelFn = function (labels) { var x, y; labels = labels || []; for (var i = 0; i < props.bars.length; i++) { x = props.bars[i].x; y = props.bars[i].y + props.bars[i].h + props.xaxisLabelOffset; props.r.text(x, y, labels[i]); } return this; }; PS: I pushed the bars into my props variable after i called Raphael to generate the chart. // immediately calls the function so that we can have

Categories : Javascript

x axis and y axis labels in pheatmap in R
The main issue here is that pheatmap, which uses grid package, creates a new grid page each time it is called. The solution I've found is: library(pheatmap) library(grid) ## Generate some data d <- matrix(rnorm(25), 5, 5) colnames(d) = paste("bip", 1:5, sep = "") rownames(d) = paste("blob", 1:5, sep = "") ## Create the heatmap: setHook("grid.newpage", function() pushViewport(viewport(x=1,y=1,width=0.9, height=0.9, name="vp", just=c("right","top"))), action="prepend") pheatmap(d) setHook("grid.newpage", NULL, "replace") grid.text("xlabel example", y=-0.07, gp=gpar(fontsize=16)) grid.text("ylabel example", x=-0.07, rot=90, gp=gpar(fontsize=16))

Categories : R

Many of axis labels
You can find examples of what you want in the following links [jqPlot documentation] : - First example - Second example And finally, Axis documentation here Edit According to your comment attached to your original post, you can do something like this (jsFiddle link) : //Declare a first series var cosPoints = [...]; //Declare a second one var cosPoints2 = [...]; //Draw a new plot with those two series $.jqplot('chart1', [cosPoints,cosPoints2], {}); //You will obtain a graph with two lines representing your two series. PS I think you definitely need to take a look at jqPlot examples here and here

Categories : Misc

Heatmap in R, representation of colors and removal of x-axis
Instead of using the basic heatmap() function, you could load the gplots package and use heatmap.2() - in your case same syntax - to get a color key. Let me know if you have any further questions about the heatmap.2() package. EDIT: Sorry, didn't read that you cannot install gplots. Is it because of limited admin rights? Unfortunately, heatmap() is kind of limited regarding the color key. But for the red -> green problem I have a solution for you. To create your own color palette, try my_palette <- colorRampPalette(c("red", "green"))(n = 1000) and then use it as color in your heat map: heatmap(..., col = my_palette, ...) How important is clustering in your case? If you don't need clustering, you can use the levelplot() function (comes with R), which has a nice color key

Categories : R

R: horizontal barplot with y-axis-labels next to every bar
Look at ?barplot arguments names.arg. Some example data: transComp <- matrix(sample(3*36), nrow=3, ncol=36) colnamesbarplot <- as.character(1:36) The barplot: barplot(transComp,space=c(0,2),legend.text=TRUE,beside=TRUE,horiz=TRUE, density=NA, col=c("red1","red4","green3"), xlab="crimes per 100,000 inhabitants", ylab="districts and years", axes=TRUE, names.arg=colnamesbarplot, cex.names=0.5, las=1) Since you have many columns to plot you should set cex.names to make the labels smaller. The argument las=1 rotates the labels by 90 degrees.

Categories : R

AChartEngine: Help needing with axis labels
It sounds like you need to disable the default numerical labels: renderer.setXLabels(0); And you also need to disable the pan and zoom operations: renderer.setPanEnabled(false, false); renderer.setZoomEnabled(false, false);

Categories : Java

Formatting chart axis labels
Set the LabelStyle.Format property accordingly: chart1.ChartAreas[0].AxisX.LabelStyle.Format = "{0:0,}K"; Documentation is here: http://msdn.microsoft.com/en-us/library/0c899ak8.aspx (Section: "The ',' Custom Specifier")

Categories : C#

r boxplot tilted labels x axis
An alternative following your original text expression: par(mar=c(6, 4.1, 4.1, 2.1)) labels <- paste(c("RB-GL830-[16]-10", "RB-GL830-[16]-30", "SB-GL834-[11]-10", "SB-GL834-[11]-30", "RB-GL843-[17]-10", "RB-GL843-[17]-30")) boxplot(count ~ spray, data = InsectSprays, col = "lightgray", xaxt = "n", xlab = "") # x axis with ticks but without labels axis(1, labels = FALSE) # Plot x labs at default x position text(x = seq_along(labels), y = par("usr")[3] - 1, srt = 45, adj = 1, labels = labels, xpd = TRUE) Why use x = seq_along(labels) for label positions? The x in text is a vector of coordinates where to put the labels. If you look at ?boxplot, you find that the at argument is a

Categories : R

x axis labels being cut off only when saving graph in r
Starting up a new graphics device resets the par values to the device defaults so you need to set mar after calling png: png("~/graph.png") ; par(mar=c(6, 4, 4, 2) + 0.1) barplot(df, beside=TRUE, ylim=c(0,100), ylab="Percentage of Positive Answers ", space=.1, main="Some Title", names.arg=c("Captivate", "Challenge", "Clarify", "Confer", "Consolidate", "Care", "Control", "Engagement"), las=2, axis.lty=1) dev.off()

Categories : R

Modifying x axis tick labels
You need to provide a function to the labels argument that maps the existing labels to new ones. Consider the following: qplot(Species,Petal.Length,data=iris)+scale_x_discrete(labels=toupper) To answer your question more directly, you would need to construct a function that maps the existing label from the data to a position in a vector of your new labels. If your existing data is a factor you could use something like: qplot(Species,Petal.Length,data=iris)+scale_x_discrete(labels=function(x) letters[1:3][which(x==levels(iris$Species))])

Categories : R

Matplotlib x-axis labels alignment off
You have converting the x data to a series of floats which are understood by python's datetime module but when passing them into p.plot(x, y) it just sees a bunch of floats. You are then essentially setting labels arbitrarily. You should use ax.plot_date(x, y, 'r-x') which accepts x as dates or the float representation. You'll need to remove your manual setting of the x labels to see this. Then see the docs for how to then custom format the x axis.

Categories : Python

Cartesian axis labels in matplotlib
One simple way to achieve this is to use the text or annotate methods of the Axes, with a kwarg transform. from mpl_toolkits.axes_grid.axislines import SubplotZero from matplotlib.transforms import BlendedGenericTransform import matplotlib.pyplot as plt import numpy fig = plt.figure(1) ax = SubplotZero(fig, 111) fig.add_subplot(ax) ax.axhline(linewidth=2.0, color="black") ax.axvline(linewidth=2.0, color="black") ax.set_xticks([]) ax.set_yticks([]) ax.text(0, 1.05, 'y', transform=BlendedGenericTransform(ax.transData, ax.transAxes), ha='center') ax.text(1.05, 0, 'x', transform=BlendedGenericTransform(ax.transAxes, ax.transData), va='center') for direction in ["xzero", "yzero"]: ax.axis[direction].set_axisline_style("-|>") ax.axis[direction].set_visible(True) for direction i

Categories : Python

Core Plot - Customize x-axis Labels
Yes, you can do this. However you will have to use the latest coreplot code from the repository. AFAIK the attributed label formatter support no available yet in the latest official release. With that formatter you can give your labels the form you want (and use only one label with a line break, instead 2).

Categories : Iphone

Dygraphs: no ticks and tick labels on x axis
There seems to be a bug in Dygraph since it does not display x axis if values are in a reverse order and presented as an array of arrays. However it seems to be working if data is present as CSV, so just add .reduce(function(a,b){return ""+a+" "+b;}) to the end of the array sequence. so your data line will look like the following: [new Date(1373197702 * 1000), 105487872],[new Date(1373197701 * 1000), 105401856] ].reduce(function (a, b) { return ""+a+" "+b; }), See http://jsfiddle.net/CUgsM/1/

Categories : Javascript

how to give labels in subplot in matlab on an axis
This cannot be done with a built in matlab function. Check out this submission on the file exchange

Categories : Matlab

Core-Plot : y Axis labels should start from 60
To make the axes cross at (0, 60), set the orthogonalCoordinateDecimal of each axis: x.orthogonalCoordinateDecimal = CPTDecimalFromDouble(60.0); y.orthogonalCoordinateDecimal = CPTDecimalFromDouble(0.0); The axis labeling policy determines how the tick marks and labels are positioned. If you are providing the tick and label positions yourself (CPTAxisLabelingPolicyNone), you can put them anywhere you want. See the "Axis Labeling Policies" demo in the Plot Gallery example app for samples of each available labeling policy.

Categories : IOS

d3.js: Align text labels between ticks on the axis
There is no easy (i.e. built-in) way of doing this, but you can still achieve it. There are a few options. The most straightforward one is probably to use the tickFormat function to specify a format with a suitable number of spaces in front/after the numbers. This would need to be hand-tuned for each application though. Alternatively, you could select the label elements after they have been drawn and add a suitable transform attribute that shifts them accordingly. Again, this would have to be hand-tuned. Your third option is to have two different axes, one for the ticks and one for the labels. The idea is that the axis that provides the ticks has no labels and the other one no ticks. You would need to set the tick values appropriately, but at least you wouldn't have to guess the right of

Categories : D3 Js

jQChart: Disable Linear x axis labels
You can use: $('#jqChart').jqChart({ axes: [ { location: 'bottom', labels: { visible : false } } ], Disclaimer: I am CTO of jqChart.

Categories : PHP

autofmt_xdate deletes x-axis labels of all subplots
This is actually a feature of the autofmt_xdate method. From the documentation of the autofmt_xdate method: Date ticklabels often overlap, so it is useful to rotate them and right align them. Also, a common use case is a number of subplots with shared xaxes where the x-axis is date data. The ticklabels are often long, and it helps to rotate them on the bottom subplot and turn them off on other subplots, as well as turn off xlabels. If you want to rotate the xticklabels of the bottom right subplot only, use plt.setp(plt.xticks()[1], rotation=30, ha='right') # ha is the same as horizontalalignment This rotates the ticklabels 30 degrees and right aligns them (same result as when using autofmt_xdate) for the bottom right subplot, leaving the two other subplots unchanged.

Categories : Python

CorePlot 1.3: setting space between axis and labels
check the axis labeling policy,set the CPTAxisLabelingPolicyAutomatic For Hint yAxis.labelPolicy = CPTAxisLabelingPolicyAutomatic For hint Please check so Answer

Categories : IOS

R: ggplot2, replace Y axis labels to geom_tile
You can use scale_y_continuous() to set breaks= and then provide labels= (for example used just letters). With argument expand=c(0,0) inside scale_... you can remove grey area in plot. ggplot(dfm, aes(x=variable, y=idsort)) + geom_tile(aes(fill=value))+ scale_x_discrete(expand=c(0,0))+ scale_y_continuous(expand=c(0,0),breaks=1:25,labels=letters[1:25])

Categories : R

How to draw a graph in R language with labels in X-axis
Here is one possibility using ggplot: ## Creating your dataset Name <-c("xy","yz","zx","vx","vt") marks1 <- c(10,20,30,20,10) marks2 <- c(30,40,40,20,20) ## Combine the data into a data frame data <- data.frame(Name,marks1,marks2) ## Loading libraries library(ggplot2) library(reshape2) ## Reshape the data from wide format to long format redata <- melt(data,id="Name") redata ## plot your data ggplot(redata,aes(x=Name,y=value))+geom_point(aes(color=variable))+ylab("Marks") The output is as follows: Updated for the file read If you have a file with the above data then you can read your data using the following command: I am assuming your file has a extension *.csv and is spaced by commas. data <- read.table("mydata.csv",header=T,sep=",") or you directly use t

Categories : R

Highcharts - how can I center labels on a datetime x-axis?
The trick is to use the x-axis labels object like this: xAxis: { type: 'datetime', labels: { useHTML: true, align: 'center', formatter: function () { //using a specific class for the labels helps to ensure no other labels are moved return '<span class="timeline_label">' + Highcharts.dateFormat(this.dateTimeLabelFormat, this.value) + '</span>'; } } You can see that the formatter will keep whatever dateTimeLabelFormat has been set by the user or default. Then have a callback that does something like this: function (chart) { var $container = $(chart.container); var $labels = $container.find('.highcharts-axis-labels .timeline_label'); var $thisLabel, $nextLabel, thisXPos, nextXPos, delta, newXPos; $labels.each(function () { $thisLa

Categories : Javascript

Multiple lines of labels for x-axis in ggplot2
One solution is to create a column specifically for your labels: I chose to only include every fourth label. Notice also that I have added " " in order to put the label on two different lines. Finally you use scale_x_discrete(labels=national.fare.long$Year_Quarter_lab) to add your custom labels. library(reshape) library(ggplot2) national.fare <- read.csv("http://www.rita.dot.gov/bts/airfares/national/csv", header = TRUE)[ , 1:4] names(national.fare) <- c("Year", "Quarter", "US_Average_Current", "US_Average_Inflation-Adjusted") # Convert Year and Quarter as characters national.fare$Year <- as.character(national.fare$Year) national.fare$Quarter <- as.character(national.fare$Quarter) # Convert to Long-version national.fare.long <- melt(national.fare, measur

Categories : R

How to rotate Y axis labels in twoord.plot in R?
Under par: I just picked a random plot that comes with twoord.plot package. x <- rnorm(100,100,10) First you need to rotate the Y axis: par(las = 1) # rotates the y axis values for every plot you make from now on unless otherwise specified Next, plot your graph without a Y axis: plotH(x,x,yaxt = 'n') # no Y axis Then, you need to add the Y axis axis(2,cex.axis = 0.5) # where 2 specifies the Y axis and 0.5 is half (0.5) of the font size as before.

Categories : R

Making the horizontal axis labels clickable
If you use a 'click' handler instead of a 'select' handler, you can more easily interact with other parts of the chart. Here's an example: http://jsfiddle.net/6LJhv/6/ Your event object, e, will have a targetID property. This targetID is not well documented, but if you run the debugger, you can get a sense of what IDs look like. On the various axis charts (Line, Column, etc.) the targetID of the axis labels look something like this: hAxis#0#label#1. To break that down, it means that you clicked on the second label of the first horizontal axis (0 based index). Given that, we can dissect the targetID to figure out which label you clicked on from the data if it's discrete. (If your data is continuous, there isn't necessarily a 1:1 relationship with the labels and rows of data) var hand

Categories : Javascript

dojo charting - axis labels don't fit on the chart
You could make the labels fixed width so that they fit. And on hover the label will have a higher z-index that the other and show the full width. http://jsfiddle.net/RU4Qc/ label { position: relative; width: 50px; height: 15px; display: inline-block; padding: 2px 5px; overflow: hidden; } label:hover { width: auto; z-index: 9999; background-color: #c0c0c0; } Hover over the text.

Categories : Javascript

Imputing new axis tick labels using seqrplot command
The problem is that by default seqrplot (as other plot functions of the seq?plot family) automatically displays the color legend together with the plot, and uses layout to organize the plot and the legend in a single graphic. If you want to act on the axes, you should disable the automatic legend by setting withlegend = FALSE, and then display the legend my hand. For example: opar <- par(mfrow=c(1,2)) seqrplot(mvad.seq, dist.matrix = mvad.dist, criterion = "density", nrep = 1, title = "End CS qualification", border = NA, axes=FALSE, withlegend=F) axis(1, at = c(1, 6, 12, 18, 24, 30, 36, 42, 48, 54, 60, 66, 70), labels = c(1, 6, 12, 18, 24, 30, 36, 42, 48, 54, 60, 66, 70)) seqlegend(mvad.seq) par(opar)

Categories : R

Putting axis category labels on stacked barplot in r
axis(3, at= c(10, 30, 70, 95) , labels=c("Always", "Most of the Time", "Some of the Time", "Never"))

Categories : R

Inserting pch data point symbols into axis labels in R
If you insist on doing this: par(mar=c(5,5,2,5), xpd=TRUE) x <- seq(0,5,0.5) y <- seq(0,5,0.5) plot(x,y, xlab="", ylab="") text(-1,2.5,"y axis text", cex=1.25, adj=0, srt=90) points(-1,2.4)

Categories : R

Individual positioning of x-axis labels in a polar highchart
You can adjust the position of the labels with the "x" and "y" options within the "labels" category under the axis definition. labels: { x: 20, y: 10 } In the above case, the labels will be 20px right and 10px down from their default position. EDIT: I re-read the title, and Im sorry, this is for all the labels, not individually. My Bad.

Categories : Javascript

Exact axis ticks and labels in R Lattice xyplot
To get your tick marks and labels where you want, you can do something along the lines of: xyplot( y~x, ylim=c(10,20), scales=list( y=list( at=seq(10,20,2), labels=c("a","","b","","c","") ) ) ) The padding issue, I'm not sure about how to address except for manually adjusting the ylim= arguments.

Categories : R

R image function of graphics package add axis labels
I think you should run image() without the axes (parameters xaxt and yaxt) and then add the axes with specified labels: par( mar = par( "mar" ) + c( 2, 4, 0, 0 ) ) image( x, xaxt= "n", yaxt= "n" ) axis( 1, at=seq(0,1,length.out=ncol( x ) ), labels= colnames( x ), las= 2 ) axis( 2, at=seq(0,1,length.out=nrow( x ) ), labels= rownames( x ), las= 2)

Categories : Image

Flot Bar Graph Align Bars with X-Axis Labels
Hey Here are some points to be noted about your fiddle. You forgot to use axis label plugin in your example.Flot doesnt have inbuild support axis label.You need to use third party plugin for it. Refer Flot plugin for axis label For issue about your bars getting cut at edges you can refer Bar chart with align center Following updated code worked for me } if (graphMode == "month") { $( "#hSlider" ).slider( "option", "min", 1.75 ); //add 0.75 offset $( "#hSlider" ).slider( "option", "max", 31.75 ); $( "#hSlider" ).slider( "option", "values", [ 1, 31 ] ); for (var i = 1; i <= 31; i++) { if (i < day) { d.push([ i, getRandomInt(1200, 1800) ]); } else { d.push([ i, 0]); } } } So you need to update your code a little to add offset to your bar wi

Categories : Javascript



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.