matplotlib

fullscreen matplotlib figures

I am visualising numpy arrays with imshow from pyplot, and would like to see just the array data in a fullscreen display with no toolbars or window borders. Running with "ipython -pylab" and then calling imshow() and show() gives me a window but pressing "f" does not toggle fullscreen mode. Is there a function call to toggle fullscreen ...

How to keep the width of the bars the same no matter the number of bars we compare in the figure?

Dear All, I want to keep the width of the bars the same no matter the number of bars compared is high or low. I am using Matplotlib stacked bar chart. the width of the bars is relative to the number of the bars. Here is my sample code. How can I make the width the same no matter the number of bars I compare from 1 to 10 import numpy ...

Matplotlib: display plot on a remote machine

Hi, I have a python code doing some calculation on a remote machine, named A. I connect on A via ssh from a machine named B. Is there a way to display the figure on machine B? ...

Plotting in a loop (with basemap and pyplot)....problems with pyplot.clf()

I am plotting some weather data for a research project. The plot consists of 18 timesteps. I decided the best way to accomplish this was to make a new plot for each timestep, save it a file, and create a new plot for the next timestep (using a for loop). For example: map_init #[Basemap Instance] extra_shapes #[Basemap.readshapefil...

How to plot a plane in Matlab or scipy/matplotlib

I feel like I should know this, but somehow I'm drawing a blank for the last 30 minutes... How would one go plotting a plane in matlab or scipy from a normal vector and a point? I keep wanting to use the symbolic math solver, but I don't have the license for it currently... :\ Sorry if this is really basic, my brain just isn't working ...

Is it possible to wrap the text of xticks in matplotlib in python?

Anyone know if it is possible to wrap the xtick labels in matplotlib? Right now I've got the following code (kind of messy -- been hacking at it for a while): def plotResults(request, question_id): responses = ResponseOption.objects.filter(question__id=question_id).order_by('order').annotate(response_num=Count('response')) counts = ...

How to combine Cmd and Matplotlib in python

Hi there, I'd like to combine interactive plotting in Matplotlib and the Command line interface Cmd in python. How can I do this? Can I use threading? I tried the following: from cmd import Cmd import matplotlib.pylab as plt from threading import Thread class MyCmd(Cmd): def __init__(self): Cmd.__init__(self) self...

repeat y axis scale along grid line of graph ( matplotlib)

Hello, I am new to matplotlib and I am trying to figure out if I can repeat the y axis scale values along the grid lines of the line graph. The graph has 2 axis, x-axis has hourly values and y-axis has temperature values. I need to show the graph for 48 hours, so it results in a long horizontal graph. when user scrolls through the ...

Unicode error using matplotlib with log scale on Windows

I'm using python 2.6 and matplotlib. If I run the sample histogram_demo.py provided in the matplotlib gallery page, it works fine. I've simplified this script greatly: --------------- import numpy as np import matplotlib.pyplot as plt mu, sigma = 100, 15 x = mu + sigma * np.random.randn(10000) fig = plt.figure() ax = fig.add_sub...

How to plot data against specific dates on the x-axis using matplotlib

I have a dataset consisting of date-value pairs. I want to plot them in a bar graph with the specific dates in the x-axis. My problem is that matplotlib distributes the xticks over the entire date range; and also plots the data using points. The dates are all datetime objects. Here's a sample of the dataset: data = [(DT.datetime.strpt...

matplotlib weirdness, it's not drawing my graph

What happened is I followed this demo, I modified it to suit my needs had it working, changed it to use a function to draw two graphs but now it doesn't work at all using plt.show() or plt.savefig() here's my code import csv import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import matplotlib.m...

matplotlib plot and imshow

The behavior of matplotlib's plot and imshow is confusing to me. import matplotlib as mpl import matplotlib.pyplot as plt If I call plt.show() prior to calling plt.imshow(i), then an error results. If I call plt.imshow(i) prior to calling plt.show(), then everything works perfectly. However, if I close the first figure that gets...

how to make a 3d effect on bars in matplotlib?

Hi, I have a very simple basic bar's graphic like this one but i want to display the bars with some 3d effect, like this I just want the bars to have that 3d effect...my code is: fig = Figure(figsize=(4.6,4)) ax1 = fig.add_subplot(111,ylabel="Valeur",xlabel="Code",autoscale_on=True) width = 0.35 ind = np.arange(len(values)) rects ...

how to force matplotlib to update a plot

I am trying to construct a little GUI that has a plot which updates every time a new data sample is read. I would prefer not to run it with a timer, since the data will be arriving at differing intervals. Instead, I'm trying to make an implementation using signals, where the data collection function will emit a signal when data is read...

Pydev can't find matplotlib modules

I just installed matplotlib on my windows 7 Python 2.6.5 machine with the win32 installer . I've tried some examples from the matplotlib site to test the installation, under Idle everthing works fine but Pydev 1.9 (Eclipse 3.6) cant find any of the sub modules. e.g import matplotlib doesn't cause any errors but from matplotlib.path ...

matplotlib matshow labels

Hi all, I start using matplotlib a month ago, so I'm still learning. I'm trying to do a heatmap with matshow. My code is the following: data = numpy.array(a).reshape(4, 4) cax = ax.matshow(data, interpolation='nearest', cmap=cm.get_cmap('PuBu'), norm=LogNorm()) cbar = fig.colorbar(cax) ax.set_xticklabels(alpha) ax.set_yticklabel...

How to embed this matplotlib code into tkinter canvas!

The matplotlib code is in http://matplotlib.sourceforge.net/examples/animation/strip_chart_demo.html I want to embed this code in my tkinter GUI,what should I do ? As it say"""This example uses gtk but does not depend on it intimately. It just uses the idle handler to trigger events. You can plug this into a different GUI that support...

Why does pip install matplotlib version 0.91.1 when PyPi shows version 1.0.0?

PyPi shows matplotlib 1.0.0. However, when I install matplotlib via pip into a virtualenv, version 0.91.1 is installed. Why the difference in versions? Is there a way to pip install matplotlib 1.0.0? Research It appears that matplotlib's DOAP record on PyPi is pointing to the correct version. Below is the DOAP record for reference:...

blank space in the top of the plot matplotlib django

Hi again people :) I've a question about matplotlib bars. I've already made some bar charts but I don't know why, this one left a huge blank space in the top. the code is similar to other graphics I've made and they don't have this problem. If anyone has any idea, I appreciate the help. x = matplotlib.numpy.arange(0, max(total)) ind...

Python: shape of a matrix and imshow()

Hello! I have a 3-D array ar. print shape(ar) # --> (81, 81, 256) I want to plot this array. fig = plt.figure() ax1 = fig.add_subplot(111) for i in arange(256): im1 = ax1.imshow(ar[:][:][i]) plt.draw() print i I get this error-message: im1 = ax1.imshow(ar[:][:][i]) IndexError: list index out of range Why do I g...