0

I want to plot the data from a connected device (which count number of steps) used by 100 users. I got about 4000 records for each user.

So I plot each point mannualy in a picture of size 100*4000 using the package PIL : Image.putpixel((CurrentTimePx,CurrentRowPx),(CurrentActivityPixelIntensity,0,0))

But the picture is too small, I have to zoom to see correctly the points.

Do you have a solution to print the picture point by point but with a correct size ?

Edit :

It's a bit more difficult : for one user, I plot a point (at time 0) for which intensity=number of steps. Then I skip to next row (for another user) and I do the same. Once I've done all the users, I skip to next column (for time 1) and so on...

I join a picture of the complete visualisation. Final Image

2 Answers 2

1

Try using matplotlib instead of PIL.

Matplotlib:

http://matplotlib.org/

Specifically about bar charts (I think this is what you want):

http://matplotlib.org/examples/api/barchart_demo.html

Sign up to request clarification or add additional context in comments.

Comments

1

I would put these data in a (100, 4000) numpy array and plot it using matplotlib. For example:

import matplotlib.pyplot as plt
# TODO: Put data in numpy array X
# TODO: Define the image size you want in my_size (eg, my_size=(10, 20))
plt.figure(figsize=my_size)
plt.imshow(X, interpolation="nearest", aspect="auto")
plt.savefig("my_plot.pdf")

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.