Search Results

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

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

  • How to center an R plot

    - by ConnorG
    I'm working on visualizing a matrix in R (almost exactly like http://reference.wolfram.com/mathematica/ref/MatrixPlot.html), and I've been using image(<matrix>,axes=FALSE) to draw the picture. However, I noticed that with the y-axis turned off, the plot isn't centered--the space is still there for the axis ticks + label. I can finagle some centering with par(oma=c(0,0,0,2.5)) but this seems inefficient and error-prone (if my matrix were to change dimensions/become non-square). Is there a better way to force the graphic to center? The right hand margin is significantly smaller than the left.

    Read the article

  • Plot smooth line with PyPlot

    - by Paul
    I've got the following simple script that plots a graph: import matplotlib.pyplot as plt import numpy as np T = np.array([6, 7, 8, 9, 10, 11, 12]) power = np.array([1.53E+03, 5.92E+02, 2.04E+02, 7.24E+01, 2.72E+01, 1.10E+01, 4.70E+00]) plt.plot(T,power) plt.show() As it is now, the line goes straight from point to point which looks ok, but could be better in my opinion. What I want is to smooth the line between the points. In Gnuplot I would have plotted with smooth cplines. Is there an easy way to do this in PyPlot? I've found some tutorials, but they all seem rather complex.

    Read the article

  • Changing text size on a ggplot bump plot

    - by Tom Liptrot
    Hi, I'm fairly new to ggplot. I have made a bumpplot using code posted below. I got the code from someones blog - i've lost the link.... I want to be able to increase the size of the lables (here letters which care very small on the left and right of the plot) without affecting the width of the lines (this will only really make sense after you have run the code) I have tried changing the size paramater but that always alter the line width as well. Any suggestion appreciated. Tom require(ggplot2) df<-matrix(rnorm(520), 5, 10) #makes a random example colnames(df) <- letters[1:10] Price.Rank<-t(apply(df, 1, rank)) dfm<-melt(Price.Rank) names(dfm)<-c( "Date","Brand", "value") p <- ggplot(dfm, aes(factor(Date), value, group = Brand, colour = Brand, label = Brand)) p1 <- p + geom_line(aes(size=2.2, alpha=0.7)) + geom_text(data = subset(dfm, Date == 1), aes(x = Date , size =2.2, hjust = 1, vjust=0)) + geom_text(data = subset(dfm, Date == 5), aes(x = Date , size =2.2, hjust = 0, vjust=0))+ theme_bw() + opts(legend.position = "none", panel.border = theme_blank()) p1 + theme_bw() + opts(legend.position = "none", panel.border = theme_blank())

    Read the article

  • Python: Plot some data (matplotlib) without GIL

    - by BandGap
    Hello all, my problem is the GIL of course. While I'm analysing data it would be nice to present some plots in between (so it's not too boring waiting for results) But the GIL prevents this (and this is bringing me to the point of asking myself if Python was such a good idea in the first place). I can only display the plot, wait till the user closes it and commence calculations after that. A waste of time obviously. I already tried the subprocess and multiprocessing modules but can't seem to get them to work. Any thoughts on this one? Thanks

    Read the article

  • How to center an R plot after removing axis labels

    - by ConnorG
    I'm working on visualizing a matrix in R (almost exactly like http://reference.wolfram.com/mathematica/ref/MatrixPlot.html), and I've been using image(<matrix>,axes=FALSE) to draw the picture. However, I noticed that with the y-axis turned off, the plot isn't centered--the space is still there for the axis ticks + label. I can finagle some centering with par(oma=c(0,0,0,2.5)) but this seems inefficient and error-prone (if my matrix were to change dimensions/become non-square). Is there a better way to force the graphic to center? The right hand margin is significantly smaller than the left.

    Read the article

  • simple plot algorithm with autoscale

    - by adrin
    I need to implement a simple plotting component in C#(WPF to be more precise). What i have is a collection of data samples containing time (X axis) and a value (both double types). I have a drawing canvas of a fixed size (Width x Height) and a DrawLine method/function that can draw on it. The problem I am facing now is how do I draw the plot so that it is autoscaled? In other words how do I map the samples I have to actual pixels on my Width x Height canvas?

    Read the article

  • google maps plot route between two points

    - by amarsh-anand
    I have written this innocent javascript code, which lets the user create two markers and plot the route between them. It doesnt work, instead, it gives a weird error: Uncaught TypeError: Cannot read property 'ya' of undefined Can someone suggest me whats wrong here: // called upon a click GEvent.addListener(map, "click", function(overlay,point) { if (isCreateHeadPoint) { // add the head marker headMarker = new GMarker(point,{icon:redIcon,title:'Head'}); map.addOverlay(headMarker); isCreateHeadPoint = false; } else { // add the tail marker tailMarker = new GMarker(point,{icon:greenIcon,title:'Tail'}); map.addOverlay(tailMarker); isCreateHeadPoint = true; // create a path from head to tail direction.load("from:" + headMarker.getPoint().lat()+ ", " + headMarker.getPoint().lng()+ " to:" + tailMarker.getPoint().lat() + "," + tailMarker.getPoint().lng(), { getPolyline: true, getSteps: true }); // display the path map.addOverlay(direction.getPolyline()); } });

    Read the article

  • Howto Plot "Reverse" Cumulative Frequency Graph With ECDF

    - by neversaint
    I have no problem plotting the following cumulative frequency graph plot like this. library(Hmisc) pre.test <- rnorm(100,50,10) post.test <- rnorm(100,55,10) x <- c(pre.test, post.test) g <- c(rep('Pre',length(pre.test)),rep('Post',length(post.test))) Ecdf(x, group=g, what="f", xlab='Test Results', label.curves=list(keys=1:2)) But I want to show the graph in forms of the "reverse" cumulative frequency of values x ? (i.e. something equivalent to what="1-f"). Is there a way to do it? Other suggestions in R other than using Hmisc are also very much welcomed.

    Read the article

  • Changing font size of legend title in Python pylab rose/polar plot

    - by LaurieW
    I'm trying to change the font size of the title of an existing legend on a rose, or 'polar', plot. Most of the code was written by somebody else, who is away. I've added:- ax.legend(title=legend_title) setp(l.get_title(), fontsize=8) to add the title 'legend_title', which is a variable that the user enters a string for in a a different function that uses this code. The second line of this doesn't return an error but doesn't appear to do anything either. The complete code is below. 'Rose' and 'RoseAxes' are modules/functions written by somebody. Does anyone know of a way to change the legend title font size? I've found some examples for normal plots but can't find any for rose/polar plots. from Rose.RoseAxes import RoseAxes from pylab import figure, title, setp, close, clf from PlotGeneration import color_map_xml fig = figure(1) rect = [0.02, 0.1, 0.8, 0.8] ax = RoseAxes(fig, rect, axisbg='w') fig.add_axes(ax) if cmap == None: (XMLcmap,colors) = color_map_xml.get_cmap('D:/HRW/VET/HrwPyLibs/ColorMapLibrary/paired.xml',255) else: XMLcmap = cmap bqs = kwargs.pop('CTfigname', None) ax.box(Dir, U, bins = rose_binX, units = unit, nsector = nsector, cmap = XMLcmap, lw = 0, **kwargs ) l = ax.legend() ax.legend(title=legend_title) setp(l.get_texts(), fontsize=8) setp(l.get_title(), fontsize=8) Thanks for any help

    Read the article

  • Model Fit of Binary GLM with more than 1 or 2 predictors

    - by Salmo salar
    I am trying to predict a binary GLM with multiple predictors. I can do it fine with one predictor variable however struggle when I use multiple Sample data: structure(list(attempt = structure(c(1L, 2L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 1L, 1L, 1L, 2L, 1L, 2L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 1L, 2L, 1L, 1L, 2L, 1L, 2L, 1L, 1L, 2L, 1L, 2L), .Label = c("1", "2"), class = "factor"), searchtime = c(137, 90, 164, 32, 39, 30, 197, 308, 172, 48, 867, 117, 63, 1345, 38, 122, 226, 397, 0, 106, 259, 220, 170, 102, 46, 327, 8, 10, 23, 108, 315, 318, 70, 646, 69, 97, 117, 45, 31, 64, 125, 17, 240, 63, 549, 1651, 233, 406, 334, 168, 127, 47, 881), mean.search.flow = c(15.97766667, 14.226, 17.15724762, 14.7465, 39.579, 23.355, 110.2926923, 71.95709524, 72.73666667, 32.37466667, 50.34905172, 27.98471429, 49.244, 109.1759778, 77.71733333, 37.446875, 101.23875, 67.78534615, 21.359, 36.54257143, 34.13961111, 64.35253333, 80.98554545, 61.50857143, 48.983, 63.81072727, 26.105, 46.783, 23.0605, 33.61557143, 46.31042857, 62.37061905, 12.565, 42.31983721, 15.3982, 14.49625, 23.77425, 25.626, 74.62485714, 170.1547778, 50.67125, 48.098, 66.83644444, 76.564875, 80.63189189, 136.0573243, 136.3484, 86.68688889, 34.82169565, 70.00415385, 64.67233333, 81.72766667, 57.74522034), Pass = structure(c(1L, 2L, 1L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 1L, 2L, 1L, 1L, 2L, 1L, 1L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, 2L, 2L, 1L, 2L, 1L, 2L), .Label = c("0", "1"), class = "factor")), .Names = c("attempt", "searchtime", "mean.search.flow", "Pass"), class = "data.frame", row.names = c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 28L, 29L, 30L, 31L, 32L, 33L, 34L, 35L, 36L, 37L, 38L, 39L, 40L, 50L, 51L, 53L, 54L, 60L, 61L, 62L, 63L, 64L, 65L, 66L, 67L, 68L, 69L, 70L, 71L, 72L)) First model with single predictor M2 <- glm(Pass ~ searchtime, data = DF3, family = binomial) summary(M2) drop1(M2, test = "Chi") Plot works fine P1 <- predict(M2, newdata = MyData, type = "link", se = TRUE) plot(x=MyData$searchtime, exp(P1$fit) / (1+exp(P1$fit)), type = "l", ylim = c(0,1), xlab = "search time", ylab = "pobability of passage") lines(MyData$searchtime, exp(P1$fit+1.96*P1$se.fit)/ (1 + exp(P1$fit + 1.96 * P1$se.fit)), lty = 2) lines(MyData$searchtime, exp(P1$fit-1.96*P1$se.fit)/ (1 + exp(P1$fit - 1.96 * P1$se.fit)), lty = 2) points(DF3$searchtime, DF3$Search.and.pass) Second model M2a <- glm(Pass ~ searchtime + mean.search.flow+ attempt, data = DF3, family = binomial) summary(M2a) drop1(M2a, test = "Chi") How do I plot this with "dummy" data? I have tried along the lines of Model.matrix and expand.grid, as you would do with glmer, but fail straight away due to the two categorical variables along with factor(attempt)

    Read the article

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

    - by John
    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.70 A1 5 1 1.70 B1 6 3 1.60 B1 7 5 1.75 B1 8 7 1.70 B1 9 1 2.10 C1 10 3 2.30 C1 11 5 2.50 C1 12 7 2.70 C1 data = data.frame (day = c(1,3,5,7,1,3,5,7,1,3,5,7), od = c(0.1,1.0,0.5,0.7 ,1.7,1.6,1.75,1.7 ,2.1,2.3,2.5,2.7), series_id = c("A1", "A1", "A1","A1", "B1", "B1","B1", "B1", "C1","C1", "C1", "C1")) r <- ggplot(data = data, aes(x = day, y = od)) r + stat_smooth(aes(group = series_id, color = series_id),method="lm")

    Read the article

  • set width of bars in matlab bar plot on logarithmic scale

    - by KatyB
    I am a bit confused on how to draw a bar graph for the following example: x_lims = [1000,10000;10000,100000;100000,1000000;1000000,10000000;10000000,... 100000000;100000000,1000000000;1000000000,10000000000;... 10000000000,100000000000;100000000000,1e12]; ex1 = [277422033.049038;24118536.4203188;2096819.03295482;... 182293.402068030;15905;1330;105;16;1]; Here, x_lims is the x axis limits for each individual bar and ex1 is the count. How can I plot these on a bar graph so that the width of each individual bar along the x axis is defined by the distance between x_lims(:,1) and x_lims(:,2) and the y value is defined by ex1? So far I have: bar(log10(x_lims(:,1)),log10(ex1)); set(gca,'Xtick',3:11,'YTick',0:9); set(gca,'Xticklabel',10.^get(gca,'Xtick'),... 'Yticklabel',10.^get(gca,'Ytick')); But I would like to (1) have the labels to be the same as if they were created using semilogx or semilogy e.g. 10^9, and (2) I would like to remove the space between the bars, for the first bar, for example, I would like to have it extend horizontally from 1000 to 10000 and then the second bar from 10000 to 100000, and so on. How can this be done?

    Read the article

  • Why the valid looking statement gives error in MATLAB?

    - by user198729
    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) + 2 ; >> plot(r,t) ??? Error using ==> plot Vectors must be the same lengths. What's wrong with the above?

    Read the article

  • Instantaneous frequency not plotting correctly in Matlab

    - by user2951069
    I'm trying to convert square wave data to instantaneous frequency and plot against time. It works correctly for one data set, but three others are plotting as shown in the image: http://i.imgur.com/iuL648o.png Time is linear, so it shouldn't be plotting like that. Anyone have any ideas as to what's going on? I'm using the following code: ddiff = diff(flow(:,1)); locations = find(ddiff(1:end-1,1)>0.1 & ddiff(2:end,1) <=0.1); for z = 2:length(locations) inst_freq(z-1) = 1/(time(locations(z))-time(locations(z-1))); freq_time(z-1) = time(locations(z)); end plot(freq_time,inst_freq)

    Read the article

  • plot an item map (based on difficulties)

    - by Tyler Rinker
    I have a data set of item difficulties that correspond to items on a questionnaire that looks like this: item difficulty 1 ITEM_6: I DESTROY THINGS BELONGING TO OTHERS 2.31179818 2 ITEM_11: I PHYSICALLY ATTACK PEOPLE 1.95215238 3 ITEM_5: I DESTROY MY OWN THINGS 1.93479536 4 ITEM_10: I GET IN MANY FIGHTS 1.62610855 5 ITEM_19: I THREATEN TO HURT PEOPLE 1.62188759 6 ITEM_12: I SCREAM A LOT 1.45137544 7 ITEM_8: I DISOBEY AT SCHOOL 0.94255210 8 ITEM_3: I AM MEAN TO OTHERS 0.89941812 9 ITEM_20: I AM LOUDER THAN OTHER KIDS 0.72752197 10 ITEM_17: I TEASE OTHERS A LOT 0.61792597 11 ITEM_9: I AM JEALOUS OF OTHERS 0.61288399 12 ITEM_4: I TRY TO GET A LOT OF ATTENTION 0.39947791 13 ITEM_18: I HAVE A HOT TEMPER 0.32209970 14 ITEM_13: I SHOW OFF OR CLOWN 0.31707701 15 ITEM_7: I DISOBEY MY PARENTS 0.20902108 16 ITEM_2: I BRAG 0.19923607 17 ITEM_15: MY MOODS OR FEELINGS CHANGE SUDDENLY 0.06023317 18 ITEM_14: I AM STUBBORN -0.31155481 19 ITEM_16: I TALK TOO MUCH -0.67777282 20 ITEM_1: I ARGUE A LOT -1.15013758 I want to make an item map of these items that looks similar (not exactly) to this (I created this in word but it lacks true scaling as I just eyeballed the scale). It's not really a traditional statistical graphic and so I don't really know how to approach this. I don't care what graphics system this is done in but I am more familiar with ggplot2 and base. I would greatly appreciate a method of plotting this sort of unusual plot. Here's the data set (I'm including it as I was having difficulty using read.table on the dataframe above): DF <- structure(list(item = structure(c(17L, 3L, 16L, 2L, 11L, 4L, 19L, 14L, 13L, 9L, 20L, 15L, 10L, 5L, 18L, 12L, 7L, 6L, 8L, 1L ), .Label = c("ITEM_1: I ARGUE A LOT", "ITEM_10: I GET IN MANY FIGHTS", "ITEM_11: I PHYSICALLY ATTACK PEOPLE", "ITEM_12: I SCREAM A LOT", "ITEM_13: I SHOW OFF OR CLOWN", "ITEM_14: I AM STUBBORN", "ITEM_15: MY MOODS OR FEELINGS CHANGE SUDDENLY", "ITEM_16: I TALK TOO MUCH", "ITEM_17: I TEASE OTHERS A LOT", "ITEM_18: I HAVE A HOT TEMPER", "ITEM_19: I THREATEN TO HURT PEOPLE", "ITEM_2: I BRAG", "ITEM_20: I AM LOUDER THAN OTHER KIDS", "ITEM_3: I AM MEAN TO OTHERS", "ITEM_4: I TRY TO GET A LOT OF ATTENTION", "ITEM_5: I DESTROY MY OWN THINGS", "ITEM_6: I DESTROY THINGS BELONGING TO OTHERS", "ITEM_7: I DISOBEY MY PARENTS", "ITEM_8: I DISOBEY AT SCHOOL", "ITEM_9: I AM JEALOUS OF OTHERS" ), class = "factor"), difficulty = c(2.31179818110545, 1.95215237740899, 1.93479536058926, 1.62610855327073, 1.62188759115818, 1.45137543733965, 0.942552101641177, 0.899418119889782, 0.7275219669431, 0.617925967008653, 0.612883990709181, 0.399477905189577, 0.322099696946661, 0.31707700560997, 0.209021078266059, 0.199236065264793, 0.0602331732900628, -0.311554806052955, -0.677772822413495, -1.15013757942119)), .Names = c("item", "difficulty" ), row.names = c(NA, -20L), class = "data.frame") Thank you in advance.

    Read the article

  • plot 4 different plots inside 1 pdf

    - by ifreak
    I have 2 data frames which i want to generate 3 plots from them and place them inside 1 pdf file as a single column. i want all the plots to have the same x-axis limits(basically the same x-axis) even thought they differ in the name and how they were obtained. the dataframes looks something like that: d1 X Y Z 0.04939317 -0.4622222 13651 0.03202451 -0.4261000 13401 0.09950793 -0.3233025 13151 0.11548556 -0.4637981 12486 0.09817597 -0.4751886 12236 0.15770701 -0.5819355 11986 and d2 V0 V1 V2 V3 sign 1 1 0.379 0.612 pos 2 1 0.378 0.620 pos 3 1 0.578 0.571 neg 4 1 0.978 0.561 pos 5 1 0.758 0.261 neg 6 1 0.378 0.126 neg P.S : both data frames are bigger than this, this is only a part of them V0, V1 and Z range from 1 to 20000 the plots that i created are : From d2 d2plot=ggplot(d1, aes(V0,V1, fill=sign)) + geom_tile()+ scale_fill_manual(values = c("neg" = "yellow", "pos"="red")) +geom_vline(xintercept =10000 ) +geom_text(mapping=aes(x=10000,y=0, label="Stop"), size=4, angle=90, vjust=-0.4, hjust=0) From d1 d1plot = ggplot(d2) + geom_errorbarh(aes(x=z,xmin=z-50,xmax=z+50, y=Y, height = 0.02),color="red")+ opts(legend.position = "none") +geom_vline(xintercept = 10000) +geom_text(mapping=aes(x=10000,y=-0.3, label="Stop"), size=4, angle=90, vjust=-0.4, hjust=0) i've tried grid.arrange(d1plot,d2plot,ncol=1) but the x-axis is different for each plot, i tried changing the aspect ratio, but this will change the y-axis ..i've also tried to use facet_wrap but the problem that my x-axis values have different values, i just want the limits and breaks to be the same and the plots all be aligned in 1 column based on 1 x-axis to comapre the value of the statistical methods in an easy way.

    Read the article

  • R scatterplot overplotting color

    - by rgeekay
    So far I have this: qplot(df[[1]], as.numeric(rownames(df)), group=df[[2]], color=df[[2]], ylab="") I want to use different colors for the points in the 2 groups - perhaps a lighter shade for the what's in black now and a darker - say, red for what's in blue. Also, I want to use hexbin kind of thing for group=0 but not for group=1. I'm not able to get the syntax to get this working. In the current plot 0 is in black and 1 is in blue. Added: I worked on it some more, and by using factor and scale_colour_manual, I got the grey color for 0 and red for 1: > palette1 [1] "grey" "red" "blue" "violet" "black" fy=factor(y, labels=c('grey', 'red')) qplot(x, seq(1:length(x)),col=fy, ylab="") + geom_point() + scale_colour_manual(values=palette1) Pending questions are: How to first plot all the grey and then red on top (some of the red is now hidden because the grey is plotted over). How to apply the hexbin logic for group0 i.e. the grey points only and not for the red.

    Read the article

  • How to enable `geom_text` to recognize `aes` in QPLOT (R programming)

    - by neversaint
    I have a data that looks like this ensg mirna_hgc time value perc id ENSG00000211521 MIR665 x 89 2.07612456747405 1 ENSG00000207787 MIR98 x 73 1.73010380622837 2 ... ENSG00000207827 MIR30A y 99 21.4532871972318 288 ENSG00000207757 MIR93 y 94 1.73010380622837 289 What I'm trying to do is to create a facet plot with label on top of it. The label can be easily called from the perc column. Using this code: dat.m <- read.delim("http://dpaste.com/1271039/plain/",header=TRUE,sep=" ") qplot(value, data=dat.m,facets=time~.,binwidth=1,main="")+ xlab("Value")+ ylab("Count")+ theme(legend.position="none")+ stat_bin(aes(value,label=sprintf("%.01f",perc)),geom="text") But it gave me this error: Error: geom_text requires the following missing aesthetics: label What I'm trying to do is to generate this plot:

    Read the article

  • plot markers on google maps with json and jquery

    - by mark
    I am trying to plot the markers as defined in a json file om Google Maps but they don't show on the map. Can somebody help me with this problem? This is the Json file: http://sionvalais.com/gmap/markers/ This is the Javascritp function: function loadMarkers() { var bounds = map.getBounds(); var zoomLevel = map.getZoom(); $.post("/gmaps/markers/index.php", {zoom: zoomLevel, swLat: bounds.getSouthWest().lat(), swLon: bounds.getSouthWest().lng(), neLat: bounds.getNorthEast().lat(), neLon: bounds.getNorthEast().lng()}, function(data) { processMarkers(data, _smallMarkerSize); }, "json" ); } function processMarkers(webcams, markerSize) { var marker = null; var markersInView = new Array(); var idsInView = new Array(); // Loop through the new webcams for (var i = 0; i < webcams.length; i++) { var idx = markers.indexOf(webcams[i].id); if (idx == -1) { var info_html = "<table class='infowindow'>"; info_html += "<tr><td class='img'>"; info_html += "<img src='" + webcams[i].smallimg + "' /><td>"; info_html += "<td><p><b>" + webcams[i].loc + "</b>"; info_html += "<br /><a href='/webcam/" + webcams[i].url + "' target='_blank'>Show webcam</a></p></td></tr>"; info_html += "</table>"; marker = new WebcamMarker(new GLatLng(webcams[i].latitude, webcams[i].longitude), {image: "" + webcams[i].smallimg + "", height: markerSize, width: markerSize}); marker.myhtml = info_html; map.addOverlay(marker); markersInView[webcams[i].id] = marker; } else { markersInView[webcams[i].id] = markers[webcams[i].id]; } idsInView.push(webcams[i].id); } // Now remove the markers outside of the viewport for (var i = 0; i < webcamids.length; i++) { var idx = markersInView.indexOf(webcamids[i]); if (idx == -1) { marker = markers[webcamids[i]]; map.removeOverlay(marker); } } markers = markersInView; webcamids = idsInView; }

    Read the article

  • Are there any decent free JAVA data plotting libraries out there?

    - by Kurt W. Leucht
    On a recent JAVA project, we needed a free JAVA based real-time data plotting utility. After much searching, we found this tool called the Scientific Graphics Toolkit or SGT from NOAA. It seemed pretty robust, but we found out that it wasn't terribly configurable. Or at least not configurable enough to meet our needs. We ended up digging very deeply into the JAVA code and reverse engineering the code and changing it all around to make the plot tool look and act the way we wanted it to look and act. Of course, this killed any chance for future upgrades from NOAA. So what free or cheap JAVA based data plotting tools or libraries do you use? Followup: Thanks for the JFreeChart suggestions. I checked out their website and it looks like a very nice data charting and plotting utility. I should have made it clear in my original question that I was looking specifically to plot real-time data. I corrected my question above to make that point clear. It appears that JFreeChart support for live data is marginal at best, though. Any other suggestions out there?

    Read the article

  • Adding trend lines/boxplots (by group) in ggplot2

    - by Tal Galili
    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, ID) a <- expand.grid(TIME, ID) colnames(a) <-c("TIME", "ID") group.id.time <- merge(a, group.id) Y <- rnorm(dim(group.id.time)[1], mean = ifelse(group.id.time$GROUP =="a",1,3) ) DATA <- cbind(group.id.time, Y) qplot(data = DATA, x=TIME, y=Y, group=ID, geom = c("line"),colour = GROUP) But now I wish to add to the plot something to show the difference between the two groups (for example, a trend line for each group, with some CI shadelines) - how can it be done? I remember once seeing the ggplot2 can (easily) do this with geom_smooth, but I am missing something about how to make it work. Also, I wondered at maybe having the lines be like a boxplot for each group (with a line for the different quantiles and fences and so on). But I imagine answering the first question would help me resolve the second. Thanks.

    Read the article

  • Fixing color in scatter plots in matplotlib

    - by ajhall
    Hi guys, I'm going to have to come back and add some examples if you need them, which you might. But, here's the skinny- I'm plotting scatter plots of lab data for my research. I need to be able to visually compare the scatter plots from one plot to the next, so I want to fix the color range on the scatter plots and add in a colorbar to each plot (which will be the same in each figure). Essentially, I'm fixing all aspects of the axes and colorspace etc. so that the plots are directly comparable by eye. For the life of me, I can't seem to get my scatter() command to properly set the color limits in the colorspace (default)... i.e., I figure out my total data's min and total data's max, then apply them to vmin, vmax, for the subset of data, and the color still does not come out properly in both plots. This must come up here and there, I can't be the only one that wants to compare various subsets of data amongst plots... so, how do you fix the colors so that each data keeps it's color between plots and doesn't get remapped to a different color due to the change in max/min of the subset -v- the whole set? I greatly appreciate all your thoughts!!! A mountain-dew and fiery-hot cheetos to all! -Allen

    Read the article

  • geom_ribbon doesn't work - Error in eval(expr, envir, enclos) : object 'variable' not found

    - by Marciszka
    I try to add a geom_ribbon object to my ggplot2 plot. In my data frame, I have an NA values that (I guess) may cause a problem. This is a reproducible example of data drame I have: base <- c(1:10, rep(NA, 10)) output1 <- c(rep(NA, 9), 10 - 0:10) output2 <- c(rep(NA, 9), 10 + 0:10) xaxis <- 1:20 df <- data.frame(xaxis, base, output1, output2) df xaxis base output1 output2 1 1 1 NA NA 2 2 2 NA NA 3 3 3 NA NA 4 4 4 NA NA 5 5 5 NA NA 6 6 6 NA NA 7 7 7 NA NA 8 8 8 NA NA 9 9 9 NA NA 10 10 10 10 10 11 11 NA 9 11 12 12 NA 8 12 13 13 NA 7 13 14 14 NA 6 14 15 15 NA 5 15 16 16 NA 4 16 17 17 NA 3 17 18 18 NA 2 18 19 19 NA 1 19 20 20 NA 0 20 And my attempt to plot a ggplot2 object with a geom_ribbon: dfm <- melt(df, id=1) ggplot(dfm, aes(x = xaxis, y = value, colour = variable)) + geom_line(aes(group=variable)) + geom_ribbon(data=df, aes(group = 1, ymin=output1, ymax=output2)) And, eventually, I got an error I cannot deal with: Error in eval(expr, envir, enclos) : object 'variable' not found Thank ypu in advance for any suggestions.

    Read the article

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