plot

Matlab subplot title and axes labels

I have the following script to ultimately plot a 4 by 2 subplot: files = getAllFiles('preliminaries'); n = size(files); cases = cell(1, n); m = cell(1, n); for i = 1:1:n S = load(files{i}); cases{i} = retransmission_distribution(S); c = size(cases{i}); m{1,i} = cell(1, c(2)); %figure(i); str_size = size(fil...

How to make a log plot in matlab

Is it possible to make a plot in matlab that does not actually take the logs of the values? I'm plotting wide ranges of values and when I try to make a log plot of them, those below 1 become negative. I would just like it to plot the values on a log scale without taking their logs. ...

How to plot a plane in Matlab or scipy/matplotlib

I feel like I should know this, but somehow I'm drawing a blank for the last 30 minutes... How would one go plotting a plane in matlab or scipy from a normal vector and a point? I keep wanting to use the symbolic math solver, but I don't have the license for it currently... :\ Sorry if this is really basic, my brain just isn't working ...

How to fit a smooth curve to my data in R?

I'm trying to draw a smooth curve in R. I have the following simple toy data: > x [1] 1 2 3 4 5 6 7 8 9 10 > y [1] 2 4 6 8 7 12 14 16 18 20 Now when I plot it with a standard command it looks bumpy and edgy, of course: plot(x,y, type='l', lwd=2, col='red') How can I make the curve smooth so that the 3 edges are r...

adjusting x-axis in R histograms

This histogram is really ugly: hist(rbinom(10000, 20000, 0.0001),freq=F,right=F) I don't want spaces between my bars. I tried different breaks= methods but they all produce similar results. Any ideas? I also want each bin value (or mean values )to be printed under the center of it's bar. ...

Arguments, Plots, Outputs and Lines of best fit in R

I have several questions to do with handling some data in R: I am using this statement: detailsTable <- read.table(file=commandArgs()[6], header=TRUE, col.names=c("a", "b", "c", "d", "e")) and it seems that the table is not being loaded correctly... but if I specify the path of the file I am loading excplicitly then all goes well. What...

How to plot two histograms together in R?

I am using R and I have two data frames: carrots and cucumbers. Each data frame has a single numeric column which lists the length of all measured carrots (total: 100k carrots) and cucumbers (total: 50k cucumbers). I wish to plot two histogram - carrot length and cucumbers lengths - on the same plot. They overlap, so I guess I also need...

How to skip certain bytes at the begining of a binary file in Gnuplot?

Say I have a binary file which has the following format: 4*sizeof(double), 4*sizeof(size_t), (Ny*Nx)*dizeof(double). The first 4 doubles and the 4 size_ts are metainformation about the file. The rest is data I want to plot with gnuplot. Right now I have to convert the file to another one without the header to plot using the command: p...

Using errorbar() with semilogy() in MATLAB?

I'd like to plot data x & y with errorbars, ebar, and its fit, yfitted, on a semilog plot. This doesn't seem to work: figure; hold on; errorbar(x,y,ebar); semilogy(x,yfitted); Instead of semilog plot I get a linear plot. What should I be doing differently? ...

R xy scatter plot marker color

Trying to do an xy scatter plot with the z value being denoted by the color of the xy point. Data: 1.1, 32.27, 19.4 1.2, 21.34, 18 1.4, 47.45, 19.4 R code: inp <- scan("beps.txt",list(x=0,y=0,z=0)) plot(inp$x, inp$y,pch=".") Creates a great scatter plot, but I would like the points to be colored by the Z value. ...

Scientific plot with Ruby + wxWidgets

I need to incorporate some scientific plot function into a program written in Ruby with wxWidgets. What's my best solution? I know that 1) PLPlot has a widget for wxWigets, but I'm not aware of any ruby bindings. 2) Python works well PLPlot and wxWigets, but I rather not rewrite the whole thing in python again. Any suggestion would be...

How to plot one line and one scatter chart into one plot with ZedGraph libraries in .net?

I am running to a problem where I have to plot one scatter (data points), the other one the best line fit(trend line) for those data points in one chart. The X axis is datetime format which I, myself, am chaning it into a double value with a base date. The plots get plotted well individually. However, I dont get good results when I combi...

Core Plot and Split Views...Impossible??

This is a general question regarding pulling up a CP plot in a split view controller. I have menu items pointing to individual view controllers pre-loaded with everything core plot related. My question is can anyone fill me in on a good way to present the graphs on the right pane while still showing the left pane? The way that I h...

Combine plots with axis normalization

I use par(new=T) before each of my plots to add my plot to the same graph. However, when I do that it superimposes the two plots and the axis values get overwritten over each other and look messed up. How do I properly add plot to the same graph that also normalizes axis intervals based on the two plots? ...

How do I make bar plots automatically cycle across different colors?

In matplotlib, line plots color cycle automatically. These two line plots would have different colors. axes.plot(x1, y) axes.plot(x2, y) However, bar plots don't. Both these data series will have blue bars. axes.bar(x1, y) axes.bar(x2, y) How do I make bar plots cycle automatically across a predefined set of colors? ...

matlab - plot 2D rectangle with interpolated color

I want to plot a 2d rect (using the rectangle function is good enough for my needs), but with a linearly interpolated color, i.e at the bottom it should be red, at the top blue, and between the two there should be the linear interpolation of the two colors. How can I do this? ...

Attempting to create iterations with MATLAB (beginner)

Hi all, I'm very very new to Matlab and I tried to attempt at making a simple iteration script. Basically all I wanted to do was plot: 1*sin(x) 2*sin(x) 3*sin(x) ... 4*sin(x) And this is the program that I wrote: function test1 x=1:0.1:10; for k=1:1:5; y=k*sin(x); plot(x,y); end % /for-loop end % /test1 However, it only pl...

Add legend outside of axes without rescaling in MATLAB

I've got a GUI in MATLAB with a set of axes pre-placed. I'm using the location property of the legend to place it to the right hand side of the axes. However, by doing this the axes get re-scaled so that the axes+legend take up the original width of the axes. Is there any way to circumvent the re-size? Example: x=0:.1:10; y=sin(x); fi...

Does anyone know how to plot a dome (aka half sphere) in MATLAB...or anyother programming language?

I need to plot a dome or half a sphere and be able to change the dimensions of the dome. I figured MATLAB would be my best choice. any suggestions? THanks ...

How to make ggplot2 plots prettier?

I have generated the following plot using the R code that follows it: ggplot(lengths, aes(length, fill = library)) + geom_density(alpha = 0.2) + coord_cartesian(xlim = c(0, 60000)) Now I would like to make the plot a bit prettier: Make the x-axis show length every 5000 units (instead of every 20000) Add x-values on top of the thre...