plot

matlab to draw ellipse and ellipsoid

how draw a ellipse and ellipsoid using MATLAB?? (x^2/a^2)+(y^2/b^2)=1 n=40; a=0; b=2*pi; c=0; d=2*pi; for i=1:n u=a+(b-a)*(i-1)/(n-1); for j=1:m v=a+(d-c)*(j-1)/(m-1); x(i,j)=sin(u)*cos(v); y(i,j)=sin(u)*sin(v); z(i,j)=cos(u); end end mesh(x,y,z); but not i want the shape?? can help me??...

Qt plotting application.

Hi All, Currently I'm trying to develop some simple plot prototype and I'm struggling with some kind of white/empty sheet syndrome. I'm back to Qt after 2 years, so I feel quite retarded. My application should: plot and manage custom layers of data plot on custom canvas background manage markers on plot My plan is to use following...

Individually labeled bars for bar graphs in matplotlib / Python

I am trying to create bar graphs of letter frequency in Python. I thought the best way to accomplish this would be matplotlib, but I have been unable to decipher the documentation. Is it possible to label the bars of a matplotlib.pyplot.hist plot with one letter per bar, instead of a numerical axis? I think it must be, but I have not use...

R from within Java

What's the best way to call R functionality from within Java? I'm looking for a quick, easy and reliable way to make standard 2d scatter plots and histograms in R using my Java applications. I was wondering which packages/interfaces that came up in a quick Google search would be most convenient to use. I look forward to your suggesti...

Plot multiple functions in R

I previously asked this question which was useful in plotting a function. I want to try and plot twenty functions on the same axes to illustrate how a function varies between two ranges. I have successfully done this using individually specified functions, but I wanted to do this using a loop. What I have attempted doing is: ## add gg...

[C++] Real time plotting/data logging

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 progr...

MATLAB: Assign multiple colors to text in legend

I'm trying to color code text in a legend. (Since I'm trying to sort several plots into different categories, I can't just rely on the line colors in the legend.) I've managed to set the text color for the entire legend, but I can't manage to assign it line by line. Is this possible? Code so far: list={'Label 1','Label 2','Label 3'}; l...

In matplotlib, how to draw a bar graphs of multiple datasets to put smallest bars to front?

I want to put multiple datasets on a bar graph and stop the smaller bars being obscured by the larger ones, and I don't want to offset them. For example, bar(0, 1.) bar(0, 2.) only shows the second bar of height of 2.0, the first bar is hidden. Is there a way to get matplotlib to draw the bars with the smallest on top? NB I don't wan...

how to draw concentric circles in an image in MATLAB?

Here is my code.... I want to draw concentric circles in a fingerprint image.. please help clear all clc id=imread('C:\Documents and Settings\Administrator\Desktop\DB1\101_2.tif'); a=size(id); sd=a/2; s=3; circle([sd(1),sd(2)],3,1000,':'); circle([sd(1),sd(2)],6,1000,':'); circle([sd(1),sd(2)],9,1000,':'); circle([sd(1),sd(2)],12,1000...

How can I plot multiple functions in R?

Using ggplot, is there a way of graphing several functions on the same plot? I want to use parameters from a text file as arguments for my functions and overlay these on the same plot. I understand this but I do not know how to add the visualized function together if I loop through. ...

How do I label two vectors in Matlab?

I have a 2 column matrix(called M, which I visualize as two vectors using Matlab's plot command(plot(M)). I have two issues: I want to label the vectors themselves on the plot. I want to label each row of the matrix(i.e. each vector component) on the plot. How would I go about doing those things? ...

Is there a way to remove the border of the legend in ggplot2?

I'm using qplot to plot a function and I want to position the legend within the plot. I've used opts( legend.position = c(0.7,0.7) ) to move the legend where I want it to be. However there is a white border around the legend and that shows up on the gray background. For example: library(ggplot2) x = c(1:20) y = c(1:20) p <- qplo...

Using ggplot2 how can I represent a dot and a line in the legend

Using ggplot2 I am plotting several functions and a series of points. I cannot figure out how to represent the points on the legend. I realize I need to use an aes() function, but I don't fully understand how to do this. I apologize that the example is so long, but I don't know how else to illustrate it. ## add ggplot2 library(ggplot2) ...

Drawing real coordinates

Hi to all, i've encountered a little problem that i can't find answer to, so i hope to find someone here to help me. So this is the problem. I have a buffer with real numbers (float) that i need to draw on my scope. I implemented a class that can draw integers only and i really don't know how to do that with float numbers as i don't kn...

Saving dotplot to pdf in R

I am having trouble saving a dotplot to pdf when this command is done inside a function. It works fine when called normally: df <- data.frame(a = runif(10), b = runif(10), c = runif(10), x = 1:10) pdf("test.pdf") dotplot(a + b + c ~ x, data = df, type = "l", auto.key=TRUE) dev.off() But if this code is inside a function, it wil...

Plotting of multiple comparisons in R ?

Hi all, When one wishes to compare (test) multiple groups (as is the case, for example, when doing anova), one is confronted with the issue of multiple comparisons. The same applys if we wish to plot the comparisons. My question is thus, what tools (in R) do you know of that allow plotting that reflects multiple comparisons? Currently...

Putting time values on the x -axis

Hi, I'm trying to put time values on the x-axis of a plot. I used the times from an excel file and import them into MATLAB by using: t = datestr(xlsread('Subject_104.xlsx', 'iButtons','A2:A2049'),'HH:MM') How can i plot my data points against these time points? Hope someone can help me here. Greets, Anne ...

How do I make a plot in Matlab if I do not know the specific size of the array?

I have some code function runTubulin() n = 10; for j = 1:n TubulinModel(); end plot(TubulinModel(), n); So my problem is that TubulinModel has a random number of outputs So I keep getting ??? Error using ==> TubulinModel Too many output arguments. Error in ==> runTubulin at 11 plot(TubulinModel(), n); Is ...

OBJ-C: Getting the minimum/maximum value in a NSMutableArray

I want to get the maximum and minimum values of a NSMutableArray so I can create a core-plot plotspace and graph based around those max and min values. My code is as follows: NSMutableArray *contentArray = [NSMutableArray arrayWithCapacity:100]; NSUInteger i; for (i=0; i<60; i++){ id x = [NSNumber numberWithFloat:i*0.05]; id y = [NSNum...

How to switch axes in matplotlib?

Hi. I like to switch x axis with y axis after plotting a graph with matplotlib? Any easy way for it? Thanks in advance. ...