Matplotlib is a plotting library for Python, built on NumPy and often used interactively with IPython. Its compact "pylab" interface is similar to the plotting functions of MATLABĀ®.

learn more… | top users | synonyms (2)

0
votes
1answer
13 views

Python-matplotlib: Can't display text on figure using a function linked to an event

I'm trying to interact with a matplotlib figure but something doesn't go as planned... Below is the sample of the script and here the description of what it should do : in the init part of my ...
0
votes
1answer
15 views

How to pad adjacency matrix cells in D3.js style?

I'm trying to replicate the matrix adjacency visualization as demonstrated in this D3.js example. Note that each cell is padded, resulting in a white border around each cell. This is what I've got so ...
0
votes
2answers
21 views

How to parse list containing decimal and datetime.datetime?

I have a list coming from sql output which looks like this [(Decimal('264'), datetime.datetime(2012, 11, 1, 0, 0)), (Decimal('445812776'), datetime.datetime(2012, 12, 1, 0, 0)), ...
0
votes
0answers
19 views

Pyplot animation not updating continuously

I'm trying to display the frames captured by a CCD camera in real-time using pyplot animation. I wrote a short python script just to test this out, and while it works, it does so erratically. It will ...
0
votes
2answers
40 views

Python plotting

I have a question about the plotting. I want to plot some data between ranges : 3825229325678980.0786812569752124806963380417361932 and 3825229325678980.078681262584097479512892231994772 but I get ...
0
votes
0answers
28 views

2D color plotting from a 3D data from txt or csv file

I have a txt file with 3 columns (x, y & z) and 16480 rows of numbers.The values in the columns are not ordered. A row looks something like: 13.75 37.5 -2E-7 I want to read data from this txt ...
0
votes
1answer
13 views

How to specify date-format using csv2rec-method

I am reading a csv-File using matplotlib.mlab.csv2rec. The first column consist of dates in the format "DD.MM.YYYY hh:mm" The dates are correctly transformed into datetime-objects as long as the ...
1
vote
1answer
27 views

Using a Matplotlib Slider to change a surface

I've created a temperature map based on several arrays (x, y, & a, where x& y are coordinates and a is the temperature). I'm trying to add a slider bar to it and keep getting TypeError: ...
1
vote
1answer
32 views

frequency trail in matplotlib

I'm looking into outliers detection. Brendan Gregg has a really nice article and I'm especially intrigued by his visualizations. One of the methods he uses are frequency trails. I'm trying to ...
0
votes
0answers
26 views

take the coordinates of the tiles in pixels, maskocean to cut the tiles on the map. basemap

I have the following map which I have added the tiles on it based on the latitudes and longitudes of the edges. 1- How can I have the coordinates in dpi. (I guess it depends on the dpi I have defined ...
0
votes
1answer
24 views

Autoscale with margin in matplotlib

In order to have a plot with autoscale axes with matplotlib, I use this code: axes.set_autoscale_on(True) axes.autoscale_view(True,True,True) It works well, and I have this plot: But I'd like to ...
0
votes
1answer
32 views

plotting a list of arrays with matplotlib

I have a list raws of arrays that I would like to plot in ipython notebook. Here is the code I am trying to get working: fig, axes = subplots(len(raws),1, sharex=True, tight_layout=True, figsize=(12, ...
1
vote
1answer
22 views

how to add a plot on top of another plot in matplotlib?

I have two files with data: datafile1 and datafile2, the first one always is present and the second one only sometimes. So the plot for the data on datafile2 is defined as a function (geom_macro) ...
0
votes
0answers
25 views

3d bar plot of lists using matplotlib, pylab

I have 3 lists def main(): x = np.arange(0.0,256.0) y = np.arange(0.0,256.0) Y,X = np.meshgrid(x,y) Z = wron(X,Y) for i in range(0,256): Z[i][0]=0 def wron(X,Y): ...
0
votes
2answers
23 views

Plotting 2 arrays against another on one graph

I want to compare how two independent variables vary with time, by plotting both of them on the one graph. All three variables are in the form of arrays, which I pulled from a text file. This is what ...
1
vote
1answer
28 views

How do I add two colorbars on the same plot in pyplot (matplotlib)?

I would like to plot one subplot like: Title 1 Fig1 Fig2 Fig3 With a common colorbar for these 3 figures (1,2,3). Title2 Fig4 Fig5 Fig6 With a common colorbar for these 3 figures ...
0
votes
1answer
30 views

Installing matplotlib on Ubuntu: ImportError

My platform: Ubuntu 13.04, Python 2.7.4. Installing matplotlib failed, ImportError: No module named pyplot. I have tried many ways such as $ sudo apt-get install python-matplotlib and easy ...
0
votes
1answer
27 views

Matplotlib fill blank image line by line, when I receive data from socket

I have data coming from a socket. I want in the beginning to create an empty image, then update this image every time I receive the data from the socket. The problem is when I receive a huge amount of ...
0
votes
0answers
23 views

Simple matplotlib Annotating example not working in Python 2.7

Code import numpy as np import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) t = np.arange(0.0, 5.0, 0.01) s = np.cos(2*np.pi*t) line, = ax.plot(t, s, lw=2) ...
1
vote
1answer
27 views

Plotting and GroupBy methods

I am just learning to take advantage of DataFrames in Pandas and I would like to use GroupBy methods to produce plots of the following: I have two dataframes, one for the x-axis information and one ...
0
votes
3answers
54 views

Python: plot 3D shape over 2D image

I'm trying to plot a 3D shape with a 2D image overlaying the xy-plane. I've only just started working with python, so this is more challenging than it ought to be. This question here addresses what I ...
1
vote
1answer
25 views

Asymmetric Error Bars in MatPlotLib

I have a loglog plot and would like to plot positive error bar for one of the 6 data points. The rest can have positive & negative. How do I work this out? Generally this is how I have plotted ...
2
votes
1answer
39 views

Matplotlib 2D graph with interpolation

I'm trying to create a plot to show a temperature gradient over a level surface. I am able to get the colors down but it is not interpolating the way I need it to. This question was helpful in ...
2
votes
1answer
33 views

Python Matplotlib: Drawing linear inequality functions

How can I draw an area bounded by some linear inequality functions using matplotlib. For example, if we have 3 functions: y <= -2+4x, y >= 2+0.5x, y <= 7 -0.3x I would like to draw somethin ...
0
votes
2answers
25 views

How can I set x-axis tick marks with only whole numbers?

I've been using host to plot my graphs, and I would like to take decimal numbers off from my x axis. My code below is kinda simplified, it represents what I need tho. I want the x-range to be exactly ...
0
votes
1answer
35 views

Plot two variables in one single y axis

I'm trying to plot two different variables in one single axis. However, when I use twinx() the result is 2 different y axis... Here is the code: def diffplot(self, xAxis, y1Axis, y2Axis): x = ...
0
votes
0answers
32 views

remove status bar of a matplotlib figure

I want to show my graph fullscreen. import numpy as np import matplotlib.pyplot as plt plt.rcParams['toolbar'] = 'None' fig = plt.figure(frameon=False) plt.show() Shortcut 'f' works fine and I ...
1
vote
1answer
29 views

matplotlib: get projection coordinates

I saw this post and added a print label.get_position(). It looks like this command returns the 2D-coordinates of the label, let's call it (u,v)-coordinates as marked green in the picture below. Now ...
1
vote
0answers
22 views

Creating a single figure from a list of figures in matplotlib

Supposing I have a list of figures (figList) such as the following (output generated in iPython): In [25]: figList Out[25]: [<matplotlib.figure.Figure at 0x63a8d90>, ...
0
votes
2answers
17 views

ipython notebook pylab inline - matplotlib.pyplot - how to display plot with scrollbar?

I am using ipython notebook with pylab --inline import matplotlib.pyplot as plt import pandas as pd ...... plt.figsize(14,8) ax1=plt.subplot(311) #data is a pandas data frame with timeseries stock ...
0
votes
0answers
33 views

Tcl error : invalid command name tcl_findLibrary

This error appears when I type the following commands (using iPython)Tkinter.Tk(), %pylab, plot ..... or run pylab in general but import pylab doesn't fire any error. Tcl error : invalid command name ...
0
votes
1answer
29 views

Matplotlib, how to connect with a line annotations if a condition is met?

I have three lists, one containing a set of symbols (characters) named "Atype", a second one "el" containing a set of numbers, each corresponding to the position+1 of an element in "AType" and another ...
1
vote
2answers
73 views

Animated title in matplotlib

I can't figure out how to get an animated title working on a FuncAnimation plot (that uses blit). Based on http://jakevdp.github.io/blog/2012/08/18/matplotlib-animation-tutorial/ and Python/Matplotlib ...
-1
votes
0answers
14 views

Formatting UNIX Time to matplotlib time format in Python

I am reading weather data which has time in format of Unix time. While plotting the data using matplotlib I want to change the time format to readable time format such as HH:MM:SS. If possible ...
-3
votes
0answers
27 views

Animating Contour Maps in Python [on hold]

I was wondering if someone has an example of how to animate a contour map where they would draw each level of the contour.
0
votes
0answers
19 views

Animating Contour maps with FuncAnimation

I am trying to animate a contour map using the matplotlib function: FuncAnimation. I am not to clear about how the fargs parameter is supposed to be set up, as the documentation isn't very specific ...
0
votes
1answer
53 views

draw a smooth polygon around data points in a scatter plot, in matplotlib

I have a bunch of cross plots with two sets of data and have been looking for a matploltib way of highlighting their plotted regions with smoothed polygon outlines. At the moment i just use Adobe ...
1
vote
1answer
39 views

Is the maximum PSD frequency bin returned by matplotlib wrong?

I am trying to understand the frequency bins returned by the matplotlib.mlab.psd() function. Using the following code I can inspect the frequencies which are returned and I'm not convinced they are ...
0
votes
1answer
19 views

“Invalid slice” when ploting using matplotlib

Python 2.7.5 and OSX 10.8 here I'm trying to plot some datas I get from a file. I'm trying to code a function where the user is able to plot from the point he wants, and have come to this part of ...
0
votes
2answers
39 views

How to have a function return a figure in python (using matplotlib)?

Assume that I have some data, and I want to create a plot of this data by passing it to a custom plotting function (myplot()). I am using the matplotlib's modules in myplot(). I would like myplot() ...
1
vote
1answer
22 views

Understanding quiver plot scale

I am trying to understand, how scale works in quiver plot. I have found an explanation here , but I want to double check, that I understand what the author says. When he says Setting the angles ...
0
votes
1answer
35 views

Matplotlib multicoloredline using lists and an external property as condition

I have 3 lists that all have same number of elements: time_list ###(float - converted from date object with matplotlib.dates.date2num) temperature_list ###(float) heating_list ###(boolean) I ...
1
vote
1answer
42 views

Drawing lines between two plots in Matplotlib

I am drawing two subplots with Matplotlib, essentially following : subplot(211); imshow(a); scatter(..., ...) subplot(212); imshow(b); scatter(..., ...) Can I draw lines between those two subplots? ...
0
votes
0answers
12 views

Issues with matplotlib._png when installing on OSX 10.6.8

I tried installing matplotlib both via pip and regular python setup.py way, and both methods result in what appears to be a successful installation. All dependencies are satisfied (including libpng). ...
0
votes
0answers
38 views

Matplotlib contour plot of matrix type

I'm getting hung trying to create a contour plot of three [1, m] numpy matrices. When I try to plot: plt.contour(reg.theta[0,:], reg.theta[1,:], reg.J[0,:]) ValueError: The truth value of an array ...
0
votes
2answers
30 views

Unable to save matplotlib.figure Figure, canvas is None

Consider (Assume code runs without error): import matplotlib.figure as matfig ind = numpy.arange(N) width = 0.50; fig = matfig.Figure(figsize=(16.8, 8.0)) ...
3
votes
1answer
33 views

Tkinter/Matplotlib backend conflict causes infinite mainloop

Consider running the following code (note it is an extremely simplified version to demonstrate the problem): import matplotlib.pyplot as plot from tkinter import * #Tkinter if your on python 2 def ...
0
votes
2answers
31 views

plotting dates from time() since the epoch with matplotlib

I'm sourcing date in second since the epoch as a floating point number ( from time.time() ) and I'm trying to plot it converting it like this (line[0]): x,y = [],[] csv_reader = ...
1
vote
0answers
27 views

MatPlotLib in Tkinter: pyplot does not format inside the window correctly

I have a code where I am embedding a matplotlib graphic in TkInter. This works fine and the data updates, but when I try to use commands like plt.x_ticks(rotation="vertical") it doesn't do it, and any ...
1
vote
1answer
22 views

Difficulty opening pylab image from buffer object

Working within web2py, using python 2.7, I've got something like this going on: import matplotlib matplotlib.use('Agg') import pylab import Image import io temp_data = {'x':[1,2,3],'y':[2,4,5]} ...

1 2 3 4 5 89
15 30 50 per page