graphing


R + ggplot : Time series with events

房东的猫 提交于 2020-01-20 10:07:08
问题 I'm an R/ggplot newbie. I would like to create a geom_line plot of a continuous variable time series and then add a layer composed of events. The continuous variable and its timestamps is stored in one data.frame, the events and their timestamps are stored in another data.frame. What I would really like to do is something like the charts on finance.google.com. In those, the time series is stock-price and there are "flags" to indicate news-events. I'm not actually plotting finance stuff, but

Graphing functions

蓝咒 提交于 2020-01-17 04:35:13
问题 I'm new to Java in general, not to mention working with GUIs and I'm working on an assignment to graph the 3 functions: (the four leafed cloves for cosine) with domain restrictions 0,4 -10,10 0 < x < 2pi I've so far made a crude graph of the first 2 functions, and no idea how to plot the third. What I have: import java.awt.*; import javax.swing.JComponent; import javax.swing.JFrame; public class DrawingStuff extends JComponent { public void paintComponent(Graphics g) { //w is x, and h is y

python 2.7 mac osx interactive plotting with matplotlib not working

家住魔仙堡 提交于 2020-01-16 00:50:43
问题 From here I found this code: import random from matplotlib import pyplot as plt import numpy as np plt.ion() # interactive mode ydata = [0] * 50 # make plot ax1 = plt.axes() line, = plt.plot(ydata) plt.ylim([0, 100]) # set the y-range while True: randint = int(random.random() * 100) ymin = float(min(ydata)) - 10 ymax = float(max(ydata)) + 10 plt.ylim([ymin,ymax]) ydata.append(randint) del ydata[0] line.set_xdata(np.arange(len(ydata))) line.set_ydata(ydata) # update data plt.draw() # update

How do I create accumulated bandwidth usages in RRDtool (ie. GB's per month down)?

吃可爱长大的小学妹 提交于 2020-01-06 21:01:17
问题 The following data comes from a mobile phone provider, it's a list of kb's downloaded at a certain time, usually on a per minute basis. It's not the average, not the max, but the total of that time interval, which allows to track the data consumption precisely. These graphs were made with PIL, and instead of showing spikes to indicate a large data consumption, large steps can be seen, which is much more revealing, because it doesn't just tell "much happened here", but "exactly this much

Graphing calculator: how to find the appropriate part of the graph to show

坚强是说给别人听的谎言 提交于 2020-01-02 08:39:28
问题 I am working on a graphing calculator (you know, one where you type in a formula, let's say x^2 and you get the graph of that function). The problem I am having is how to offset and scale the view of graph as to show the interesting section of the function. I have exhausted all the 'simple' ideas I have had. Let me show some example: - sin(x) => interesting section is between y = [-1,1] and offset (0,0) - x^2 => interesting section is between y = [0, 100] and offset is (0,0). (100 has been

How do I plot 2 points in a graph in a GUI?

ⅰ亾dé卋堺 提交于 2019-12-25 06:16:21
问题 I am trying to make a GUI that will plot 2 points in a line graph and draw a line segment from those two points. I cannot find any examples in any of my Java textbooks, and almost every example that I try to search for is too complex to understand in the short amount of time that I have. Is there anyway to explain graphing easily to a beginner in Java? 回答1: Use a Canvas as your drawing surface. Use the drawLine() function to draw a line between X1,Y1 and X2,Y2. There are lots of samples out

How do I plot 2 points in a graph in a GUI?

空扰寡人 提交于 2019-12-25 06:16:09
问题 I am trying to make a GUI that will plot 2 points in a line graph and draw a line segment from those two points. I cannot find any examples in any of my Java textbooks, and almost every example that I try to search for is too complex to understand in the short amount of time that I have. Is there anyway to explain graphing easily to a beginner in Java? 回答1: Use a Canvas as your drawing surface. Use the drawLine() function to draw a line between X1,Y1 and X2,Y2. There are lots of samples out

Highcharts help - Area chart stacking

╄→尐↘猪︶ㄣ 提交于 2019-12-25 03:47:22
问题 Maybe I am not understanding the area chart properly but here is an image to properly display what the problem is and what I am looking for: Can someone explain why stacking: normal display values like it does? And how to possibly fix it? I have tried stacking: null, and stacking: percent, but both do not give the desired results. EDIT: I see my error, however, I'm not sure how to fix it. I need to graph the two series in a group so that they are rendered together and not normalized. Any

Matplotlib: plot multiple individual plots in a loop

纵饮孤独 提交于 2019-12-25 03:27:36
问题 I want to plot multiple benchmarks, each on a separate plot. Here's my code: for benchmark in benchmarks: readFile = open(benchmark+'.txt') text = readFile.read() x = re.findall(r"(\d+)",text) x = [int(i) for i in liveRatio] pylab.plot(x) F = pylab.gcf() F.savefig('benchmark',dpi=200) The code plots all the data on the same plot. But, I want individual separate plots for each benchmark. 回答1: You need to clear the figure before each plot call: for benchmark in benchmarks: readFile = open

How can I ask matlab to give me the value of y if I input the value of x?

纵然是瞬间 提交于 2019-12-25 03:16:41
问题 I already have my xy graph using the line graph. What troubles me is how can I ask matlab to give me the value of y if I give the value of x. That is, the corresponding value of y when I give x in the line I have in the graph. 回答1: What I think you want to do is interpolation. Say your x and y values that you used for plotting are stored in xData and yData , respectively. Then, you find a value y that corresponds to a value x using INTERP1 y = interp1(xData,yData,x); By default, interp1

工具导航Map