After all, matplotlib is being used by scientists to plot data and prepare reports - so it includes everything one needs. Due to the good documentation and the amount of example code available online, it's easy to learn and use, and I don't think you'll have much trouble translating gnuplot code to it. The plots it produces are beautiful - "publication quality" for sure. Matplotlib has pretty good documentation, and seems to be quite stable. Plt.xlabel('Number of points in the scatter graph') Plt.plot(numberOfPoints, matplotlibTime, label="matplotlib") Plt.plot(numberOfPoints, gnuplotTime, label="gnuplot") # Generate string call to a gnuplot plot and save, call it and save execution time # Generate string call to a matplotlib plot and save, call it and save execution time Y = np.random.randint(sys.maxint, size=val) X = np.random.randint(sys.maxint, size=val) # Init matplotlib to avoid a peak in the beginningįor idx, val in enumerate(numberOfPoints):īar = "▕" + "▇"*progress + "▁"*(progressBarWidth-progress) + "▏" + str(idx) + "/" + str(n-1) Here's the code to generate the graph if you want to give it a try on your machine: # -*- coding: utf-8 -*-įrom timeit import default_timer as timer But you will have to put more sweat into that to do it with Gnuplot. Moreover, as mentionned in the comments, you can get equivalent quality of plots. I remember the performance gap being much wider when running on an older computer with older versions of the libraries (~30 seconds difference for a large scatter plot). The following graph represents the required time (in seconds) to: I've added some code to test it out on your machine and see for yourself if it makes a real difference (this is not a real performance benchmark but should give a first idea). However, if you really need performance, you could use Gnuplot. Here is my conclusion: if you have a not-so-big data set, you should use Matplotlib. I know this post is old and answered but I was passing by and wanted to put my two cents. Matplotlib = ease of use, Gnuplot = (slightly better) performance
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |