w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
While Sending Html Mails from my web application Recieved Mails contains Symbols like &ldquo,&rdquo, ‘
Check with another constructor for htmlView: ContentType mimeType = new System.Net.Mime.ContentType("text/html"); var htmlView = AlternateView.CreateAlternateViewFromString(bodyMessage, mimeType);

Categories : Asp Net Mvc

MATLAB: surf Plot after rotating my data
For anyone interested, I have found the solution. If you ever want to rotate a 3-D matrix where the x,y,z data is located in the 3rd dimension, use the following for maximum speed and efficiency. [m,n,z]=size(inMatrix); outMatrix=reshape((A*(reshape(double(inMatrix),[m*n 3]))')',[m n 3]); Where inMatrix is your initial 3d matrix, outMatrix is your output 3d matrix, and A is your rotation matrix. Can be extremely useful when wanting to code rotations in images, since images will have 2 dimensions along their width and height, and the 3rd dimension will be the x, y and z coordinates. This will allow you to easily plot an initial data set, rotate it, then replot it.

Categories : Matlab

Smooth surf plot of spectrogram in Matlab
If you increase your overlap, it will be smoother: [~,~,T,P]=spectrogram(W(:,end),200,199,256,fs); But will also take longer to calculate. That's the trade-off.

Categories : Matlab

How to plot two lines in one graph in MATLAB?
It's confusing that you've called these X and Y. Assuming that they are actually two lines with linearly-increasing x-coordinates, you have some options. The simple way is to use hold: plot(X); hold on; plot(Y); hold off; The other way is to combine them into a matrix. Provided they are the same length (and assuming column vectors): plot( [X Y] ); But more fundamentally, you have shown your data as a cell array instead of a vector. You should convert these to vectors first. You can use cell2mat for this: Xv = cell2mat(X)'; Yv = cell2mat(Y)'; plot( [Xv Yv] );

Categories : Matlab

matlab plot graph (only show >threshold)
The plot function takes two arguments, the x values and the y values. If you want to plot from 0 to 1000, set the x value: x = ((e-1)*1000):(e*1000); plot(x, rows(e,:)); ... In order to plot the 'o' at the correct x value, include the x argument: plot(peak_x(beat_count), rows(e,peak_x(beat_count)),'ro'); ... If you want to print data to a file every time the user finishes a segment, open the file for appending right after the above line: fid = fopen('OUTPUTFILE.txt', 'at'); fprintf(fid, 'x = %d; peak = %f ', peak_x(beat_count), peaks(beat_count)); fclose(fid);

Categories : Matlab

how to plot an edgelist as a network graph in matlab
Do you have the bioinformatics toolbox? In that case: Create a sparse adjacency matrix from the edgelist: Adj_mat = sparse(from_list, to_list,1,nb,nb); Thereafter, create a biograph object: bg = biograph(Adj_mat, "some properties"); h = view(bg); This will create a directed graph. If you want an undirected graph: Adj_Tri = tril(Adj_mat + Adj_mat'); bg = biograph(Adj_Tri,[],'ShowArrows','off','ShowWeights','off'); h = view(bg);

Categories : Matlab

Reading CSV File and using Surf to plot time series-data
You will find an answer on the matlab help page here. I reproduce its relevant example below. You will have to repeat these steps for each time point. One the many solutions to achieve a surface plot with X,Y,Z vectors is : -Generate unevenly sampled data within the range [-8, 8] and use it to evaluate the function: x = rand(100,1)*16 - 8; y = rand(100,1)*16 - 8; r = sqrt(x.^2 + y.^2) + eps; z = sin(r)./r; -The linspace function provides a convenient way to create uniformly spaced data with the desired number of elements. The following statements produce vectors over the range of the random data with the same resolution as that generated by the -8:.5:8 statement in the previous sinc example: xlin = linspace(min(x),max(x),33); ylin = linspace(min(y),max(y),33); -Now use these points

Categories : Matlab

Matlab plot graph(segment by segment) and user input threshold value before writing to txt
You need to put the input statement outside the loop, or it will be evaluated multiple times (every time all the other conditions are true). But really, there are far more efficient ways to do what you want - based on the fact that matlab likes statements to be vectorized (operate over the entire array at once). Here are a few ideas: rows = reshape( data, 1000, []); % the [] means "figure out what this dimension has to be so it works" d1 = diff( rows, 1 ); % take "first derivative" along first non-singleton dimension pkLocs = find(d1(1:end-1,:)>0 & d1(2:end,:) < 0 ); % peak = where derivative changes sign threshold = input('Key in the threshold value:'); [pk_i pk_j] = ind2sub( size(d1), pkLocs ); pkVals = rows( sub2ind( size(rows), pk_i, pk_j) ); aboveThr = find( pkVals > th

Categories : Matlab

Different SURF Features Extracted Between MATLAB and OpenCV?
Under the hood, MATLAB uses OpenCV for some of its computer vision functions, including detecting SURF features. If you look inside the $matlabroot/bin/$arch folder, you'll find OpenCV shared libraries in addition to a gateway library ocv.dll). In fact, the same reference paper is mentioned in the documentation of both, which suggests that the algorithm parameters have the same meaning in both frameworks. MATLAB Herbert Bay, Andreas Ess, Tinne Tuytelaars, Luc Van Gool "SURF: Speeded Up Robust Features", Computer Vision and Image Understanding (CVIU), Vol. 110, No. 3, pp. 346--359, 2008 OpenCV Bay, H. and Tuytelaars, T. and Van Gool, L. "SURF: Speeded Up Robust Features", 9th > European Conference on Computer Vision, 2006 First thing, make sure you are using the same pa

Categories : Matlab

SURF feature extraction on a dense grid with MATLAB
[nRows, nCols] = size(grayImg); STEP = 10; colInd = (1 : STEP : nCols)'; rowInd = (1 : STEP : nRows)'; [A, B] = meshgrid(colInd, rowInd); densePoints = [A(:) B(:)]; [featuresDense, validPointsDense] = extractFeatures(grayImg, densePoints, 'Method', 'SURF'); figure, imshow(img) title('Dense SURF') hold on plot(validPointsDense)

Categories : Matlab

How to plot grouped bar graph in core plot?
Use the barOffset property to shift the plots off the given bar location slightly. For example, with three plots, you might give the first plot an offset of -0.2, the second an offset of zero (the default), and the third an offset of +0.2, assuming your bars are one location unit apart.

Categories : IOS

Matlab: Saving plot images, override plot.m
you can simply use the print command and save them into a directory that you can also make using the mkdir command. Sample code clc; close all; clear all; x = 1:10; y = x.^2; plot(x,y) if exist('plots','dir') ~= 7 mkdir('plots'); % make directory if it does not exist end print -dpdf ./plots/jawn.pdf Read the print documentation, to learn how to print in other file formats Also, I would not suggest overriding the plot command, and you will likely not be able to find the source code for plot.m because that is proprietary MATLAB code

Categories : Matlab

Legend does not match plot lines on MATLAB plot
The display of the red line as a full line is curious. In any case it's related to your plotting a vector against a scalar. This will plot equal length vectors and generate the behavior you expect: plot(y, g, '-k', y, P1*ones(1,length(y)), ':r', y, P3, '--b');

Categories : Matlab

Matlab; Scatter plot- shift the plot
Use the axis command: >> axis([0 1 0 1]); to set the limits of the axis (the range displayed). See axis doc for more info.

Categories : Matlab

Matlab density plot, Heat map, Matlab
You can control the colour of each point like so: scatter(x1, y1, [], C) where C is the same size as your x1 and y1 matrices. Now if you describe the rules of how you want this heatmap colour modulation to happen, we can help you construct C from x1 and y1...

Categories : Matlab

Matlab get an average plot out of several plot
Assuming you don't have access to the original data you used for doing the plots: plot_data = get(get(gca,'Children'),'YData'); % cell array of all "y" data of plots average = mean(cell2mat(plot_data)); In order for this to work, you have to use this code right after doing the plots, that is, without plotting to any other figure (gca is a handle to the current axes).

Categories : Matlab

plot a line graph in vb.net
Entity Framework would be a good way to do it. EF returns a class object that represents a table. Then you make a query and can apply filters and get an IEnumerable(Of {record}) then you can iterate this List and supply the parameters from the record. A function would be a better fit for parsing a field and returning a value based on the given string. EF simplifies getting your data and placing it in a class/property format so you can use it in code. Documentation Tutorial Example: For Each rec As Record In dbModel.Records.Where(Function(o) o.clientId = clientId).ToList Chart1.Series("Student").Points.AddXY(rec.Name, GetYValue(rec.Amount)) Next Private Function GetYValue(value As string) As Integer Dim result As Integer = 0 Select Case value Case "r" result = 0 Case

Categories : SQL

data to be given to plot on graph
You are probably looking for what type to use to store in database, if it is So: LONGTEXT is probably excessive -- it allows data sizes up to 4GB. MEDIUMTEXT allows 16MB. TEXT allows 64KB. TINYTEXT allows only 255 characters. Very few HTML documents are going to be 64KB in size, so a TEXT ought to be suitable for you. If you really want to be safe, go for a MEDIUMTEXT. Reference: http://dev.mysql.com/doc/refman/5.0/en/string-type-overview.html

Categories : Jquery

how to plot graph using ggplot in R
Assuming your customer id is unique, this might be a solution: # df--> your posted data # converting string to factor df[ ,1] <- factor(df[,1]) # here the standard R produce this plot: plot(df[,1]) # if you prefer eg. ggplot require(ggplot2) qplot(df[,1]) + ylab("Frequency")+xlab("Quarters")+ geom_bar(fill="lightblue") hth

Categories : R

Plotting graph in GNU PLOT using C#
The problem seems to be that gnuplot cannot find the requested file. The working directory of the process is not set to the gnuplot directory, but probably to the directory of the application that is calling gnuplot. EDIT Try to add either of the following lines to your code somewhere before the extPro.Start() command: extPro.StartInfo.WorkingDirectory = @"E:gnuplotin"; or Environment.CurrentDirectory = @"E:gnuplotin"; If this is not working, it might be because your application does not have read access to that directory. Try placing your insert.dat file in a directory that with certainty can be accessed by any client application. BTW, I also do not recognize the Standardization property that you are using? That line should rather read: extPro.StartInfo.RedirectStandardInput =

Categories : C#

Is it better to plot android Graph using JAR or OpenGL
Address your platform you want to use This speed issue can weigh in on both ends. The library (jar as you call it) approach will be faster to draw initially because I assume they draw on canvas. We use this approach to draw some complex charts on our app. This way is simple and straight forward. The charts are mostly static with some features for interaction. The OpenGL approach will take longer to render initially because it needs to first load the GLView and start up OpenGL before the chart can draw and this can sometimes be time consuming but as soon as this is loaded it will be way faster to perform draw operations and fancy features than the jar approach. In the end it comes down to what you want to do. If you only want to plot a chart and update it with the latest data I wouldn't

Categories : Android

R: plot multiple lines in one graph
You should bring your data into long (i.e. molten) format to use it with ggplot2: library("reshape2") mdf <- melt(mdf, id.vars="Company", value.name="value", variable.name="Year") And then you have to use aes( ... , group = Company ) to group them: ggplot(data=mdf, aes(x=Year, y=value, group = Company, colour = Company)) + geom_line() + geom_point( size=4, shape=21, fill="white")

Categories : R

Core Plot bar graph - Bar does not show up
The datasource should check the plot field using the predefined constants (CPTBarPlotFieldBarLocation, CPTBarPlotFieldBarTip, and CPTBarPlotFieldBarBase) rather than using "magic" numbers. Most bar plots will require at least a location and a tip value for each bar. Be sure the datasource returns the correct value for each field. The length of a plot range should be max - min, not max. In this case, it doesn't matter since the min value is zero, but it will matter in other cases. There are many examples of bar plots in the Core Plot example apps. The Plot Gallery app is a good place to start.

Categories : Iphone

Click on the graph core-plot
Look at the example apps included with Core Plot. The Plot Gallery has an example of adding a label when the user clicks a plot. The Mac version of CPTTestApp shows another technique of drawing a crosshairs over the selected point on a scatter plot. Each plot has its own delegate that will be notified of the click. The delegate methods all have the sending plot as one of the parameters so you can use the same delegate object to handle more than one plot.

Categories : IOS

How to manually plot Box and Whisker graph?
that might be a solution: #create a dummy boxplot that you can modify the data easily z<- boxplot(1:10) #look at the outbut an assign yout data to stats z$stats<- your_data #use bxp to plot, via add you can combine all three bxp(z) or use the bxp function from the beginning.. see also: http://r.789695.n4.nabble.com/Box-plot-with-5th-and-95th-percentiles-instead-of-1-5-IQR-problems-implementing-an-existing-solution-td3456123.html ben

Categories : R

Plot graph iteratively during every update
If you don't care too much about which color is which cluster, or you feel like constructing a color map (which is actually pretty easy), you can just do this without the for loop (your first piece of code): plt.scatter(y[:,0],y[:,1],c=z,cmap='Paired') (or substitute 'Paired' for you color map).

Categories : Python

How to plot a grouped bar graph in R with different data structures
Here you go: c <- c(1,2) d <- c(3,5) e <- c(5,6) f <- c(4,4) dat <- cbind(c,d,e,f) barplot(dat,beside=TRUE) This is pretty introductory stuff in R - I suggest you take a read of a few tutorial websites before asking too many basic queries on stackoverflow. E.g.: http://www.statmethods.net/graphs/bar.html http://www.harding.edu/fmccown/r/#barcharts http://www.r-tutor.com/elementary-statistics/qualitative-data/bar-graph

Categories : R

Core Plot Bar Graph Y-Axis issues
As I seem to be finding with most things xcode, it is all about where you put your code. If I have CPTPlotRange:PlotRangeWithLocation:Length before I do my set up it is really slow and buggy. If instead I add it to the end of my code after setting the other values for the axises suddenly there is only a very minor delay. I actually got this code originally from a tutorial and modified it to fit what I needed but I guess the tutorial didn't have the same delay because the length of the data was much lower. So all I did to fix this problem was put the following code after my axis set up instead of before; CPTXYPlotSpace *plotSpace = (CPTXYPlotSpace *) graph.defaultPlotSpace; plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0)

Categories : IOS

How to plot line graph using json in Highchart?
Two things: categories should be an array of strings, so: remove extra array here: var mydata = [[]]; -> var mydata = []; remove extra array here: mydata[0].push([line2[i].time]); -> mydata.push(line2[i].time); data should be an array of numbers, so remove extra arrays the same way as for categories.

Categories : Json

How to plot stack series line graph in R?
Here is some code that will give you what you want. #Example Data n = 6 time02H = abs(rnorm(n)) time06H = abs(rnorm(n)) time24H = abs(rnorm(n)) allPAL.DE = data.frame(time02H,time06H,time24H) plot(0,0,xlab="Time",ylab="Values",type="n",xlim=c(0,2),ylim=c(min(allPAL.DE,0),max(allPAL.DE)),axes="FALSE") box() axis(1,0:2,c("time02H","time06H","time24H")) axis(2) abline(h=0,col="grey",lty=2,lwd=2) for(i in 1:nrow(allPAL.DE)){ lines(0:2,allPAL.DE[i,],col=i,lwd=2) } You could add different options, colors and text to make the plot look nicer but its the basic idea that you were asking for.

Categories : R

R: using Matplot to plot a table and a curve on same graph and same scale
Is this what you're looking for? If so, all you need to do is add lines(dpois(1:42, lambda = 10)). That is: y = dput(structure(c(0.241441201887921, 0.503290567041149, 0.195639167719205, 0.0422788007711228, 0.00811008442464934, 0.00152895034235192, 0.00033238050920694, 0.000132952203682776, 0.000199428305524164, 6.6476101841388e-05, 6.6476101841388e-05, 6.6476101841388e-05, 0.00099714152762082, 0.000731237120255268, 0.00232666356444858, 0.00106361762946221, 0.000465332712889716, 0.000132952203682776, 0.000199428305524164, 0.000531808814731104, 0.00033238050920694, 6.6476101841388e-05), class = "table", .Dim = 22L, .Dimnames = structure(list( c("1", "2", "3", "4", "5", "6", "7", "

Categories : R

How do I plot a bar graph in ggplot where my bins are year-months
I think this works: Edit: Per the comments below mydates$months <- month.abb[as.numeric(format(mydates[, 1], format = "%m"))] mydates$Months <- paste(mydates$months, format(mydates[, 1], format = "%y")) mydates$Months <- factor(mydates$Months, levels = paste(month.abb, c(rep(12, 12), 13))) ggplot(mydates, aes(Months)) + geom_bar()+ scale_x_discrete(drop=FALSE) + theme(axis.text.x = element_text(angle=90, vjust=.3)) The labels could be adjusted by making the bars horizontal with coord_flip() or using theme(axis.text.x = element_text(angle=90, vjust=.3))

Categories : R

iOS Draw n number of bar graph Dynamically using core plot
Your question is still at a higher level but i will try to answer as per my understanding: where i set the identifier dynamically : You can have some constants strings which you can use for setting identifiers. If you want to make it completely dynamic take a counter and use it's value to set as identifier like: plot.identifier = [NSString stringWithFormat:@"%d",counter]; Create the plot inside a loop as per dynamic req. and just after creating instance set the identifier as per counter. how handle every bar draw calculation in side delegate : This is not so clear what you want to know. This method is called according to count you will pass in delegate method: -(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plotnumberOfRecords { return someCount; } The delegate method "numberFor

Categories : Iphone

How to graph multiple lines in a single plot ggplot2?
Assuming you put the xaxis variable (Date) in selectedxaxis, the selected products in selectedproducts and with data holding the loaded data: selectedxaxis = "Date" selectedproducts = c("Sodas", "Salads") widedata = subset(data, select = c(selectedxaxis, selectedcolumns)) longdata = melt(widedata, id.vars=selectedxaxis, variable.name='Product', value.name='Count') ggplot(longdata) + geom_line(aes(Date, Count, color=Product))

Categories : R

Making a simple line graph with NO core plot
You can draw it yourself using CoreGraphics. In the drawRect of a UIView (or custom image context). { // find min and max values of data float max = -HUGE_VALF, min = HUGE_VALF; for (int i = 0; i < dataCount; i ++) { min = MIN(min, data[i]); max = MAX(max, data[i]); } // build path for (int i = 0; i < dataCount; i ++) { // line spacing is the distance you want between line vertices float x = i * lineSpacing; // scale y to view height float y = ((data[i] - min) / (max - min)) * self.bounds.size.height; if (i == 0) { CGContextMoveToPoint(ctx, x, y); } else { CGContextAddLineToPoint(ctx, x, y); } } // stroke path (configure color, width, etc be

Categories : Iphone

How to plot line graph in java/jsp using database values?
You could use Dojo Toolkit for this. Only JavaScript is required. Ajax is possible but not required.

Categories : Jsp

Discrepancy in graphs created in R for-loop and single R plot (graph)
Probably not the most elegant and it did not answer my question...I removed the for-loop, created an array in bash of the items I wanted and looped through it - each time calling the R script with the array item as the R script argument. Not pretty -- but it works.

Categories : R

Excessive lag when loading view controller containing Core Plot graph
Is maxDailyCaloriesInDataset large? The default axis labeling policy puts tick marks and labels one unit apart along the axis. If the yRange is large, this creates a lot of overlapping labels, which can be very slow. Depending on the requirements of your app, either increase the majorIntervalLength so it doesn't make so many labels, or change the labeling policy. CPTAxisLabelingPolicyAutomatic and CPTAxisLabelingPolicyEqualDivisions would be good choices.

Categories : IOS

Highchart datetime graph x-axis unable to get data on plot when min and max is on
Although you are specifying min and max, your data has no x values specified, so it is assuming that the date time values are starting at 0. There are several ways to render the chart you want. Firstly, you could specify x values in your data points e.g. {x:Date.UTC(2011, 0, 1),y:2165} Another way is to not use a datetime axis type, and just specify the categories you want in the x-axis: categories:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"] The second option is probably a bit simpler http://jsfiddle.net/K6xxz/

Categories : Javascript

Core Plot - set zoom level to show only part of graph
You need to set the xRange and globallXRange properties to get work. plotSpace.xRange = [CPPlotRange plotRangeWithLocation:CPDecimalFromFloat(0.0) length:CPDecimalFromUnsignedInteger(10)]; [plotSpace setGlobalXRange:[CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(0.0) length:CPDecimalFromUnsignedInteger(50)]]; Pass location and length values correctly.

Categories : Iphone



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