plot

Matlab multiple graph types inside one graph

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

charts in R programme

hi every body i want to write programme in R to draw some charts in the same plot, so if any body can help me i well be regardes to them ...

Calculate area under FFT graph in MATLAB

Currently I did a FFT of a set of data which gives me a plot with frequency at x axis and amplitude at y axis. I would like to calculate the area under the graph to give me the energy. I am not sure how to determinate the area because I am without the equation and also I only want a certain area of the plot rather than whole area under...

Different right and left axes in a MATLAB plot?

I plot a single trace in MATLAB with plot(). I'd like to add a right-y axis with a different set of tick marks (scaled linearly). Is this possible? ...

How to remove the upper and right borders of a graph border?

Is it possible to selectively remove left, bottom, right or upper portions of a graph border? ...

Python: x-y-plot with matplotlib

I want to plot some data. The first column contains the x-data. But matplotlib doesnt plot this. Where is my mistake? #fresnel formula import numpy as np from numpy import cos from scipy import * from pylab import plot, show, ylim, yticks from matplotlib import * from pprint import pprint n1 = 1.0 n2 = 1.5 #alpha, beta, intensity dat...

Curve fitting: Find the smoothest function that satisfies a list of constraints.

Consider the set of non-decreasing surjective (onto) functions from (-inf,inf) to [0,1]. (Typical CDFs satisfy this property.) In other words, for any real number x, 0 <= f(x) <= 1. The logistic function is perhaps the most well-known example. We are now given some constraints in the form of a list of x-values and for each x-value, a pa...

Plotting Implicit Algebraic equations in MATLAB

I wish to plot implicit functions in MATLAB. Like x^3 + xy + y^2 = 36 , equations which cannot be made into simple parametric form. Is there any simple method ? I guess it is a very noob-ish question, sorry ..... have never gone exotic in MATLAB ! ...

Funny plots in MATLAB: what does lower scale mean?

I recently learned the ezplot function in MATLAB. Recently I typed in ezplot('x^y - y^x', [-100 100 -100 100]); and this is what I got; Can anyone please tell me whatever is happening ? for lower scaling of x and y ( [ -10 10 -10 10]) there are more patterns in the 2nd 3rd and 4th quadrants. I was not very sure of the shape o...

How can I use gnuplot to plot data that is in an un-friendly format?

I need to graph some data that is not exactly in the most friendly format, most examples or usage puts things in a nice column/table that is very easy to parse and graph. However I have the following format (and am a bit stuck as to how to tackle this): DATE1 label_1 xx yy DATE1 label_2 xx yy DATE1 label_3 xx yy DATE2 label_2 xx yy DAT...

Plotting Bessel functions

How do you plot a Bessel function (2d) of the 1st kind in Matlab? ...

R: ggplot2, how to get the parameters from a plotted linear model smoother?

I have a data.frame with 3 time series in it, shown below. When I plot them with a smoother time series, I want to be able to get the parameters of the linear model that I plot, but I can't see how to do that? > data day od series_id 1 1 0.10 A1 2 3 1.00 A1 3 5 0.50 A1 4 7 0.7...

Add multiple hist fit to a figure, without the hist

Hello, I'm a matlab newbie, and i'd like to superpose some hist fit on a same figure. I know the function histfit, but unfortunatly i can't get to remove the hist and only keep the curve. I guess once i'll know how to do that i'll be able to add several curves using "hold on". Thanx for any answers or advices! ...

Reading values in MATLAB and assigning coordinates to the entries

Hi, I'm a bit new to MATLAB. Basically, I have a 20x20 values , complete with various random entries ranging from 0 to 3. I need to write a program that reads this 20x20 square, 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...

R: What are the pros and cons of using Lattice versus ggplot2?

R: What are the pros and cons of using Lattice versus ggplot2? ...

Adding trend lines/boxplots (by group) in ggplot2

Hi all, I have 40 subjects, of two groups, over 15 weeks, with some measured variable (Y). I wish to have a plot where: x = time, y = T, lines are by subjects and colours by groups. I found it can be done like this: TIME <- paste("week",5:20) ID <- 1:40 GROUP <- sample(c("a","b"),length(ID), replace = T) group.id <- data.frame(GROUP,...

Why the valid looking statement gives error in MATLAB?

It's from this question。 Why the two solutions doesn't work, though it looks very valid for me: >> t = -pi:0.1:pi; >> r = ((sin(t)*sqrt(cos(t)))*(sin(t) + (7/5))^(-1)) - 2*sin(t) + 2 ; ??? Error using ==> mtimes Inner matrix dimensions must agree. >> t = -pi:0.1:pi; >> r = ((sin(t).*sqrt(cos(t))).*(sin(t) + (7/5)).^(-1)) - 2*sin(t) + ...

How to get the stars command to have segments of different angles ? (in R)

I am playing with the "stars" ({graphics}) function to create a segment of flowers. I wish to plot a flower of segments, for example in way the following command will produce: stars1(mtcars[, 1:7], draw.segments = T, main = "Motor Trend Cars : stars(*, full = F)", full = T, col.radius = 1:8) But, I want the segments to not ...

3D plotting in Matlab

I'm using the subplot and then surf functions to generate images in 3D in Matlab. How do I get rid of the axes and axis' gridlines and change the color to all yellow or all green or something like that? Thanks. ...

Plotting data with meshgrid

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