Search Results

Search found 832 results on 34 pages for 'plot'.

Page 8/34 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Why doesn't JFreeCharts correctly connect the points in my xy-line graph?

    - by Javajava
    /Each letter A,T,G,C represents a direction for the plot to graph. Specifically, “A” means move right, “T” is move down, “C” is move up, and “G” is move left. When the applet reads A,T,C, it plots the graph correctly. However, when I plot G, the graph is messed up. When I input "ACACACA," the graph is like a rising staircase. When I input "gtgtgt," the graph should look like a staircase, but it looks like a lightning bolt instead/ /This is all one code... i don't know why it's all split up like this:/ import java.applet.Applet; import java.awt.*; import java.awt.event.*; import java.util.Scanner.*; import java.jfree.chart.*; import java.jfree.data.xy.*; import java.jfree.chart.plot.PlotOrientation; public class If_Graph extends Applet implements ActionListener{ Panel panel; TextArea textarea, outputArea; Button move; String thetext; Scanner reader = new Scanner(System.in); String thetext2; int size,p,q; int x,y; public void init(){ setSize(500,500); //set size of applet panel = new Panel(); add(panel); setVisible(true); textarea= new TextArea(10,20); add(textarea); move=new Button("Graph"); move.addActionListener(this); add(move); } public void actionPerformed(ActionEvent e) { XYSeries series = new XYSeries("DNA Walk"); x= 0; y = 0; series.add(x,y); if(e.getSource() == move) { thetext=textarea.getText(); //the text is the DNA bases pasted thetext=thetext.replaceAll(" ",""); //removes spaces thetext2 = ""; for(int i=0; i<thetext.length(); i++) { char a = thetext.charAt(i); switch (a) { case 'A': //moves right x+=1; y+=0; series.add(x,y); break; case 'a': x+=1;y+=0; series.add(x,y); break; case 'C': //moves up x+=0; y+=1; series.add(x,y); break; case 'c': x+=0; y+=1; System.out.println(x + "," + y); series.add(x,y); break; case 'G': //move left x-=1; y+=0; series.add(x,y); System.out.println("G is: "+ x +"," +y); break; case 'g': x-=1; y+=0; System.out.println("g is: " +x + "," + y); series.add(x,y); break; case 'T': //move down x+=0; y-=1; series.add(x,y); System.out.println("T is: "+ x +"," +y); break; case 't': x+=0; y-=1; series.add(x,y); System.out.println("t is: "+ x +"," +y); break; default: // series.add(0,0); break; } } XYDataset xyDataset = new XYSeriesCollection(series); JFreeChart chart = ChartFactory.createXYLineChart ("DNA Random Walk", "", "", xyDataset, PlotOrientation.VERTICAL, true, true, false); ChartFrame frame1=new ChartFrame("DNA Random Walk",chart); frame1.setVisible(true); frame1.setSize(300,300); outputArea.setText(thetext2); } } }

    Read the article

  • finding out the selectted section of a pie chart in iphone

    - by sandeep sinha
    I am using Core-Plot to draw the pie chart.I am having no issues in drawing the pie chart.I need the pie chart to be interactive in nature, i.e., if I click on any particular section on pie chart, it should navigate to the next page showing details of that particular section. Kindly help me in this regard. I tried using -(void)pieChart:sliceWasSelectedAtRecordIndex: but its not working . The method is not being called.

    Read the article

  • matlab and gplot

    - by JPC
    Hi, Im trying to find a way to plot a truss in matlab, i can do it by using an adjacancy matrix and the gplot function, but its very long winded approach especially if there are a lot of nodes connected to one another. Is there a faster way to do this? I'm new to matlab and the programming world any help would be really appreciated. JC

    Read the article

  • [C++] Real time plotting/data logging

    - by Paul
    I'm going to write a program that plots data from a sensor connected to the computer. The sensor value is going to be plotted as a function of the time (sensor value on the y-axis, time on the x-axis). I want to be able to add new values to the plot in real time. What would be best to do this with in C++? Edit: And by the way, the program will be running on a Linux machine

    Read the article

  • Scientific Plotting in Python

    - by user100046
    I have a large data set of tuples containing (time of event, latitude, longitude) that I need to visualize. I was hoping to generate a 'movie'-like xy-plot, but was wondering if anyone has a better idea or if there is an easy way to do this in Python? Thanks in advance for the help, --Leo

    Read the article

  • Plotting data with meshgrid

    - by Ruby
    When you use meshgrid to plot data (using meshgrid itself not one of the other plotting functions), how do you change the color to grayscale or black and white? Also, how do you get rid of the "meshy" look of the image?

    Read the article

  • Using Google Maps v3, PHP and Json to plot markers

    - by bateman_ap
    Hi, I am creating a map using the new(ish) v3 of the Google Maps API I have managed to get a map displaying using code as below: var myLatlng = new google.maps.LatLng(50.8194000,-0.1363000); var myOptions = { zoom: 14, center: myLatlng, mapTypeControl: false, scrollwheel: false, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("location-map"), myOptions); However I now want to add a number of markers I have stored in a PHP array. The Array currently looks like this if I print it out to screen: Array ( [0] => Array ( [poiUid] => 20 [poiName] => Brighton Cineworld [poiCode] => brighton-cineworld [poiLon] => -0.100450 [poiLat] => 50.810780 [poiType] => Cinemas ) [1] => Array ( [poiUid] => 21 [poiName] => Brighton Odeon [poiCode] => brighton-odeon [poiLon] => -0.144420 [poiLat] => 50.821860 [poiType] => Cinemas ) ) All the reading I have done so far suggests I turn this into JSON by using json_encode If I run the Array though this and echo it to the screen I get: [{"poiUid":"20","poiName":"Brighton Cineworld","poiCode":"brighton-cineworld","poiLon":"-0.100450","poiLat":"50.810780","poiType":"Cinemas"},{"poiUid":"21","poiName":"Brighton Odeon","poiCode":"brighton-odeon","poiLon":"-0.144420","poiLat":"50.821860","poiType":"Cinemas"}] The bit now is where I am struggling, I am not sure the encoded array is what I need to start populating markers, I think I need something like the code below but not sure how to add the markers from my passed through JSON var locations = $jsonPoiArray; for (var i = 0;i < locations.length; i += 1) { // Create a new marker };

    Read the article

  • R adding infrequent date 'events' to a time series plot

    - by flyingcrab
    Hi, I am just starting on R - and have hit a bit of a deadlock with some time series data. I have a time series (date and value) in 'zoo' format, that I want to annotate with a cross when an event occurs. The events are irregular and in a csv format (just the dates, sometimes repeated). I've managed to read in the dates etc into a format that R accepts - but i cant seem to get a means to chart the main time series with the secondary events annotated on top?

    Read the article

  • Y-axis in MATLAB bar plot is hidden.

    - by Claus
    I am drawing a simple bar diagram in MATLAB. The problem is, that the value at x = 0 lets the y-axis disappear partially. Is there a way to bring the y-axis to the front instead of hiding between the y-value for x=0? Is there any option I can make sure the y-axis is always in the front?

    Read the article

  • Plot hex tiles with different length sides?

    - by Phil
    I'm trying to create a basic grid of hex tiles. I found some code... s=h/Math.cos(30*Math.PI/180)/2; tile._x=x*s*1.5; tile._y=y*h+(x%2)*h/2; That does just that, but I think it's setup for hex's that have same length sides. However my hex has different length sides. It's width is 140 and it's height is 80. I could completely change the code to work with my side lengths, but I was wondering if there's a better way of doing it with the code above.

    Read the article

  • Core-Plot graph in a UIViewController

    - by Kenneth
    Hi guys, im trying to put a Coreplot graph in a UIView. Some questions, should i do it in XIB? or should i do it programmically ? If so how should i write the codes? etc. I actually have two Classes. one called GraphView which is supposed to hold the Coreplot graph. Another called CorePlotViewController. Thx for looking guys.

    Read the article

  • matplotlib.pyplot, preserve aspect ratio of the plot

    - by Headcrab
    Assuming we have a polygon coordinates as polygon = [(x1, y1), (x2, y2), ...], the following code displays the polygon: import matplotlib.pyplot as plt plt.fill(*zip(*polygon)) plt.show() By default it is trying to adjust the aspect ratio so that the polygon (or whatever other diagram) fits inside the window, and automatically changing it so that it fits even after resizing. Which is great in many cases, except when you are trying to estimate visually if the image is distorted. How to fix the aspect ratio to be strictly 1:1? (Not sure if "aspect ratio" is the right term here, so in case it is not - I need both X and Y axes to have 1:1 scale, so that (0, 1) on both X and Y takes an exact same amount of screen space. And I need to keep it 1:1 no matter how I resize the window.)

    Read the article

  • program R- in ggplot restrict y to be >0 in LOESS plot

    - by Nate
    Here's my code: qplot(data=sites, x, y, main="Site 349") (p <- qplot(data = sites, x, y, xlab = "", ylab = "")) (p1 <- p + geom_smooth(method = "loess",span=0.5, size = 1.5)) p1 + theme_bw() + opts(title = "Site 349") Some of the LOESS lines and confidence intervals go below zero, but I would like to restrict the graphics to 0 and positive numbers (because negative do not make sense). How can I do this?

    Read the article

  • Difference between chart, plot and graph

    - by Pradyumna
    I'm thinking of what would be the right terms to use in the UI of my new program, when referring to graphical data representations - i.e., whether to call them "charts", "plots" or "graphs". I was wondering how these terms are different, and when is it appropriate to use each of them? Thanks, Pradyumna

    Read the article

  • MATLAB: Need to make a 4D plot (3D + Colour/Color)

    - by user1305624
    I need to make a 3D surface where colour will represent the fourth variable. I know "surf" is SIMILAR to what I need, but that's not quite it. Basically, I have the following variables: t = [1:m] y = [1:n] a = [1:o] These should be the three Cartesian corodinate axes. I also have a variable S that is of dimensions m x n x o, and is basically the amplitude, a function of the previous three variables (i.e. S = f(t,y,a)). I want this to be represented by colour. So to summarize, I need a graph of the form (t,y,a,S), where the first three variables are vectors of unequal sizes and the final variable is a multidimensional array whose dimensions are determined by the first three. Thanks in advance.

    Read the article

  • Plot multiple files

    - by LucaB
    Hi I'd like to make an animation that illustrates the positions of some agents I'm simulating under Linux. Basically, I have some files named file00001.dat, file00002.dat and so on. I have to generate "something" that get files in order, and output an animated gif, a dynamic graph or whatever, that simulates the moving reading data from file. I have control on the files, meaning that I can put identifiers or everything I want. How would you achieve that? What programs would you use?

    Read the article

  • plot a line graph in vb.net

    - by Husna5207
    this is my function for plotting a graph in vb.net how I'm going to replace the ("Jon", 10),("Jordan", 30) with a value that i search from database ? Private Sub chart_btn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chart_btn.Click Chart1.Series("Student").Points.AddXY("Jon", 10) Chart1.Series("Student").Points.AddXY("Jon", 10) Chart1.Series("Student").ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Bar End Sub

    Read the article

  • LAbeling with Percentage in R plot

    - by Libo Cannici
    Hi I have made this function that takes a table and prepare the label for a barplot prepare_labels <- function(ft){ labs <- ft labs <- paste(labs, "\n", sep="") labs <- paste(labs, round(prop.table(ft)*100,2), sep="") labs <- paste(labs, "%", sep="") return(labs) } It actually works fine, but is there any better way to write that function, the above code looks ugly and I want to write beautiful code :-) ex: ft <- table(mydata$phone_partner_products) prepare_labels(ft) [1] "3752\n34.09%" "226\n2.05%" "2907\n26.41%" "1404\n12.76%" "1653\n15.02%" [6] "1065\n9.68%"

    Read the article

  • Matlab multiple graph types inside one graph

    - by mirekys
    Hi, I have a task to draw electrostatic field between two electrodes( at given sizes and shape ), what i have now is that i draw the electrodes with area plot (area(elect_x,elect_y)) the graph looks like this: ------------------.--- |.. .---. |.. |...| |.. .----....| |.. |........| |.. ---------------------- and now i would need to draw inside this probably a mesh, showing the field. Is there any way to do it, or i´m on a wrong way? Thank you very much for every guide

    Read the article

  • Toottip data issue in jquery flot

    - by Muhammad
    I am using Jquery plot.Every thing is working except tooltip data. Total data shown on a line is 190 which is equal to total published PLUS total unpublished.Total Published is 51 which is shown in tooltip.Now the other portion of tooltip shows 190 instead of 190-51 = 139 here is my code var options1 = { series: {stack: stack, lines: { show: lines, fill: false, steps: steps }, bars: { show: bars, barWidth: 0.4 }, points: { show: true} }, grid: { hoverable: true //IMPORTANT! this is needed for tooltip to work }, tooltip: true, tooltipOpts: { content: "%s : %y", shifts: { x: -60, y: 25 } }, legend:{'position':'ne','show':true,'margin':[-3, -20],'backgroundOpacity':0.1, 'noColumns': 4, 'container': null}, xaxis: {ticks: dest4 ,}, }; what i should do with this line to show exact data content: "%s : %y",

    Read the article

  • subplot matplotlib wrong syntax

    - by madptr
    I am using matplotlib to subplot in a loop. For instance, i would like to subplot 49 data sets, and from the doc, i implemented it this way; import numpy as np import matplotlib.pyplot as plt X1=list(range(0,10000,1)) X1 = [ x/float(10) for x in X1 ] nb_mix = 2 parameters = [] for i in range(49): param = [] Y = [0] * len(X1) for j in range(nb_mix): mean = 5* (1 + (np.random.rand() * 2 - 1 ) * 0.5 ) var = 10* (1 + np.random.rand() * 2 - 1 ) scale = 5* ( 1 + (np.random.rand() * 2 - 1) * 0.5 ) Y = [ Y[k] + scale * np.exp(-((X1[k] - mean)/float(var))**2) for k in range(len(X1)) ] param = param + [[mean, var, scale]] ax = plt.subplot(7, 7, i + 1) ax.plot(X1, Y) parameters = parameters + [param] ax.show() However, i have an index out of range error from i=0 onwards. Where can i do better to have it works ? Thanks

    Read the article

  • Reading Matrices in MATLAB and assigning coordinates to the entries

    - by Michael Schofield
    Hi, I'm a bit new to MATLAB. Basically, I have a 25x25 Matrix, complete with various random entries ranging from 0 to 3. I need to write a program that reads this matrix, and assigns x-y coordinates to the entries, so that when I ask for an input of a particular x-y coordinate which has, say an entry of 3, then it will result in an error. I'm a bit overwhelmed - but I understand the general concept of what I'm supposed to be finding. I'm wondering if I should use a plot instead to help me.

    Read the article

  • Matlab Error- fplot();

    - by udsha
    >> fplot(fh,[-2 4]) ??? Undefined function or variable "e". Error in ==> myfun at 3 Y(:,2) = e(:).^x; Error in ==> fplot at 102 x = xmin; y = feval(fun,x,args{4:end}); I tried to plot two function using this m file. function Y = myfun(x) Y(:,1) = 3*x; Y(:,2) = e(:).^x;

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >