I'm trying to generate plot for each department and security rating, but all get is just one plot with latest values retrieved from dictionary holder:
my code is here:
https://codeshare.io/aYleWY
how to get:
graph
graph
graph
... but not as a subplot?
EDIT:
Corrected the code, and corrected the bug which repeated same data everywhere, but my plots lost Y axis altogether, any idea why?
You may add the statement plt.figure() in the beginning of your last for-loop in order to create a new figure on each iteration. Good luck!
Related
I'm new to python and matplotlib. I need to plot a live graph from a CSV file which is being updated in real time. This is what I'm trying to do:
Just keep plotting as soon as a new value is updated into the file. It's procedural, as soon as I write the new data into the file, I read it again and plot. The number of readings may go higher than 1000. Maybe even 10000. (1000 or 10000 lines in CSV file, each line contains a unique x value and a corresponding y value). I'm plotting in a tkinter canvas. I need to plot the latest 50 values in the file, but also keep the previous values so that I can stop the graph, drag and see previous values. Plotting is fine, I understand how to get it done. But how much Ram/time and other resources does this process take. How does it affect the performance of the application and is there a better way to accomplish this? Note that after a while, I'll have an array with maybe 10000 values in it. Then I'll have to plot it.
The legend on my plot shows various entries; however, I can only see one dataset actually plotted in the graph. How can I show the rest?
The code that I am using is the following:
HPI_data = pd.read_pickle('pandas_pickle.pickle')
print(HPI_data.head())
#note: all data points are being printed correctly up to this point so I do not think that there is anything nothing wrong with the pickling.
HPI_data.plot()
plt.legend().remove()
plt.show()
# the plot only shows only dataset for some reason!
The following shows the actual output of print(HPI_data.head()):
House pricing index raw data
The output displayed is exactly how I want to be; however, the issue I am dealing with is with the plotting.
Hi my problem is: I am doing an android app where there is a plot that plots data in real time that it reads from the bluetooh, I can add the y-values to the plot dynamically without any problem,but I'd like to change every second also the values of the domain, the plot plots a new data value every second so I'd like that the domain axis updates it's values every second. How can I do this can u please help me??? thanks
Take a look at the solution provided in this question. You should be able to adapt this to your needs by injecting your own logic into the format(...) method.
I have 3 sets of data x,y,z where z represents the scan steps and z=50. Corresponding to z I have a each values of x and y. I want to plot a line or contour plot at 5th, 10th and 20th scan steps. Is it possible and which function should I use?
I don't fully understand how your data is organized, but Matplotlib is the easiest way to pop up a contour plot: see this for example:
http://matplotlib.org/examples/pylab_examples/contour_label_demo.html
If you remove the last past of that URL, you can browse the entire gallery for more examples, some of which may be closer to what you are try to do.
A more involved and more powerful alternative would be Chaco. You can refer to this example:
http://docs.enthought.com/chaco/user_manual/annotated_examples.html#contour-plot-py
Mayavi is for 3D plotting which doesn't seem to be what you are trying to do. If you are curious, checkout:
http://docs.enthought.com/mayavi/mayavi/
Hope this helps.
I need to get Excel to graph about 5 points into a single curve. I'm looking for is the average of all the point if the points don't line up perfectly. I'm not very familiar with graphing on Excel, so it's very possible I've overlooked some option to get what I'm trying to achieve.
This is an example of what I'm looking for:
It looks liek what you're looking to do is add a trendline to a scatterplot.
I've included some screenshots below.
Inital graph showing 3 groups of data we want to 'average':
Adding trendline to the points:
Trendline settings:
Final result: