graphing

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

On the browser, how to plot 100k series with 64-128 points each?

巧了我就是萌 提交于 2019-12-24 10:38:22
问题 I want to graph about 120k series, each of them having 64 points (down sampled, 128-512 points if using the real sampling rate, which is even larger) I have attempted to do it with dygraph but it seems to be very slow if i use more than 1000 series. I have attempted to use vanilla WebGL, it drew really fast, but than my problem was getting the mouse's click and than deciding which series it was - any strategies on this? (I believe its called unprojecting?) - since there are 100k+ series,

how would I implement realtime graphing in Silverlight/WP7?

倖福魔咒の 提交于 2019-12-23 20:50:21
问题 I'm trying to implement realtime graphing of data in my WP7 app. Can someone point me in the right direction on how to go about doing this? To clarify, by real-time I mean a graph that updates every second. thanks in advance 回答1: The charting controls from VisiBlox support WP7, are free and come highly recommended. There's also a video demonstrating functionality on YouTube. X-Ref: Charting Library for Windows Phone 7 with Zooming & Panning? 回答2: It may depend on what you mean by realtime but