0
votes
0answers
8 views

Combining an imshow colormap with Python Pandas subplot line charts

I have a Pandas DataFrame that has pairs of columns -- each pair has a measurement column that I want to plot as a line chart and another column that I want to plot as an imshow colormap to illustrate ...
1
vote
0answers
5 views

Cannot save matplotlib animation with ffmpeg

I am trying to save a simple matplotlib animation from Jake Vanderplas, but I keep getting OSError: [Errno 13] Permission denied. I should note that I made two small modifications to Jake ...
0
votes
1answer
19 views

Creating a simple bar graph with matplotlib?

I am attempting to create a basic bar graph using matplotlib that displays data for a reddit bot that returns the top 10 words used out of all your comments. Its y-axis being the number of times used ...
0
votes
1answer
12 views

Why doesn't Twisted keyboard example work with threads?

I'm trying to edit the Keyboard IO example http://twistedmatrix.com/documents/current/core/examples/stdin.py so that I can type command while a realtime plot is happens and change what is plotted. I ...
1
vote
0answers
16 views

How can I make an animation with contourf()?

I'm trying to animate the wigner function of the spatial coordinates of some time-dependent data. The wigner function is 2 dimensional, so I'm using contourf() to plot it. I have the data stored in a ...
0
votes
0answers
11 views

label from array in scatter plot with discrete colours

I want to create a scatter plot of values from the first two columns of an array W, with the colours given by another array categories (that takes values in 0-3 inclusive). I managed to do this using ...
3
votes
0answers
18 views

Choosing a matplotlib backend for a specific IPython profile

matplotlib has a config file and IPython has its own. Which one has precedence when it comes to setting things like matplotlib backends? For example, say my config file for matplotlib says to use a ...
0
votes
1answer
12 views

No minor grid lines on the x-axis only

I'm trying to product a plot in which the y-axis has both major and minor gridlines, while the x-axis has only major gridlines. It's straightforward enough to disable minor grid lines on both axes, ...
7
votes
2answers
40 views

Plot histogram with colors taken from colormap

I want to plot a simple 1D histogram where the bars should follow the color-coding of a given colormap. Here's an MWE: import numpy as n import matplotlib.pyplot as plt # Random gaussian data. ...
2
votes
2answers
47 views

plotting dynamic data using matplotlib

I'm writing an application do display data that changes dynamically (the data being read from a socket). As a dummy case, I try to draw a sine with an amplitude multiplied by 1.1 each second: ...
0
votes
1answer
27 views

Two ranges on a horizontal oriented colorbar ticks are 'floating away' from colorbar

Using this I can plot two ranges on a vertical oriented colorbar. Consequently I would like to try to do the same for a horizontal oriented colorbar. This works, but partly. First the code: import ...
1
vote
1answer
22 views

Making a contour plot with solutions from systems of differential equations with pylab

So, I'm solving a system of differential equations numerically i have x,y,z each a solution. Each array is one dimensional and and for example x[0],y[0],z[0] goes with a point in space. i want to ...
1
vote
1answer
39 views

Generating your own colormap in SciPy

I'm using Python and Scipy to perform some basic image manipulation. I've made the image greyscale and subtracted it from a gaussian blur of itself as a form of edge detection. Now I'd like to make it ...
0
votes
0answers
18 views

python GUI to EXE with image and modules

I have created a Python GUI and trying to convert it to .exe with py2exe. i am using following modules wx,matplotlib,numpy,time,serial,random and a .ico image as logo. i tried create a setup.py file ...
1
vote
1answer
34 views

Matplotlib - plotting waveform from a wav file

I'm working on a program that aims on hiding user-specified data in wav files (steganographical program, but only for educational use, nothing extremely sophisticated). Aside from doing the ...
1
vote
1answer
21 views

Animating Langdon's Ant in Python with Matplotlib

doing some problems on Project Euler, I came across Langdon's Ant and thought it would be a nice idea to try to code an animation of it in Python. As a basis, I went and used the matplotlib function ...
0
votes
0answers
24 views

pythonbrew python2.6.2 matplotlib with no Tkinter

I installed python 2.6.2 using pythonbrew (pythonbrew) along with numpy 1.4.0rc2 on my Ubuntu 12.04 64bit OS. Now I want to get matplotlib 1.2.1rc1 running properly. I can build, install and import ...
4
votes
1answer
26 views

Matplotlib: change (main) plot legond label text

So far I have been able to label the subplots just fine but I'm having an issue with the main one... Here's the relevant part of my code: data_BS_P = data[channels[0]] data_BS_R = data[channels[1]] ...
0
votes
1answer
27 views

Matplotlib: image.get_window_extent(renderer) produces all zeros

I am finding that the get_window_extent method for an image object gives all zeros. For example import numpy as np import matplotlib.pyplot as plt im = np.array([[0.25, 0.75, 1.0, 0.75], [0.1, ...
0
votes
0answers
34 views

saving figure using matplotlib

I have multiple plots each displayed in each tab(each tab is a page in wx.Notebook). I have attached the code snippet used to plot the figure in each tab. Everything is fine till I try to save a ...
0
votes
1answer
12 views

Pandas and Matplotlib - how can I change plot area to fit in more x-axis text?

Say I read in this csv file into a pandas dataframe: File contents: Strings, Values, Letters Made up data, 55.0, A with long text strings for index, 125.5, B with long text strings for index, 85.5, ...
1
vote
1answer
21 views

Identify and count points inside a user defined segment

I'm trying to identify and count data points that are within a user defined "wedge" selection. The data points each have their own ID number and are being loaded from a CSV catalog file, while the the ...
0
votes
1answer
26 views

Matplotlib excessive memory use

Given below is the code for reading values from a file and plotting them. I am reading about 36000 values. I am using matplotlib to plot them. If the values are below a certain threshold I am deleting ...
-1
votes
0answers
30 views

Error while running the python code on ubunu12.04 LTS

Please find below the snippet of code am running, i get the below mentioned error while executing this snippet on ubuntu12.04 LTS 32 bit, please let me know if any one has gone through this same setof ...
2
votes
2answers
53 views

How to determine if a black-box is polynomial or exponential

I have a problem which essentially reduces to this: You have a black-box function that accepts inputs of length n. You can measure the amount of time the function takes to return the answer, but you ...
0
votes
0answers
16 views

Using Mayavi to make 3D graphs, with Matplotlib-style axes

I've been messing around with Mayavi for 3D graphing, and I can graph the scatter plot I want but can't seem to get the Axes to look proper. I found the following previous question that starts to get ...
0
votes
2answers
31 views

Getting unexpected output when plotting with Matplotlib - Cmap - Python

I have a method in my project in which I verify if a pixel has the desired reliability (in terms of its classification as edge or not) and I plot the pixels in the following scheme: White -> pixel ...
0
votes
2answers
27 views

How to customize axes in 3D hist python/matplotlib

I am trying to plot this data set using 3D bar B A freq 1 2003 2 1 2003 2 2 2008 1 2 2007 2 2 2007 2 3 2004 1 1 2004 3 1 2004 3 1 ...
0
votes
1answer
20 views

How to plot specific rows and columns of pandas dataframe (based on name of row and name of column) in bar plot with error bars?

I have data in a csv file structured like so: Subject group Result1 Result2... ResultN 101 a .5 .1 .2 103 b .1 .2 ...
0
votes
2answers
17 views

Standard ASCII File Format For Plotting from Matplotlib

I am working on a large hardware testing project, and one of the things I've run into is that I'd like to plot data coming out of the Python scripts on the systems doing the testing, but they aren't ...
0
votes
1answer
20 views

Use Func animation python

The following code has been taken from here and modified to fit my requirements: import numpy as np from matplotlib import pyplot as plt from matplotlib import animation import math import linecache ...
1
vote
0answers
21 views

pylab.imshow() command brings up blank figure

I'm very new to working with Ipython and the Ipynotebook, but I need to for an upcoming class. Using the notebook, I imported pylab, created a data set using a matrix, and tried to display that data ...
1
vote
0answers
40 views

Normalize an Array to Standard Normal Distribution

I think this is a pretty simple question but I wasn't able to find an answer. I have an array: array([ 62519, 261500, 1004836, ... , 0, 0]) I would like to convert it to a normal distribution with ...
2
votes
1answer
35 views

Get the background color of a widget - really

I'm having trouble getting the actual background color of widgets. In my special case I'm having trouble with widgets within a QTabWidget. This is on Windows7. So classic widgets have some greyish ...
0
votes
1answer
30 views

How can I calculate frequency axis after FFT

I have a time series data and I capture some part of it then use numpy.fft.rfft command after that I use plt.plot(2*abs(result)/len(result)) to show rfft result how can I calculate freq axis? My ...
0
votes
0answers
17 views

3d projection of an object that has a shape of circle, square and triangle with Matplotlib

Is it possible to plot object similar to this figure on 3d space with Python Matplotlib and how would you make it? I found an example, but don't really know, how to move on from this: ...
3
votes
1answer
36 views

How to modify pandas plotting integration?

I'm trying to modify the scatter_matrix plot available on Pandas. Simple usage would be Obtained doing : iris = datasets.load_iris() df = pd.DataFrame(iris.data, columns=iris.feature_names) ...
0
votes
2answers
40 views

How to plot 3D hist in python

I have dataset that contains accidents in a region with a year. > Accident_ID Region Year > 213 1 2003 > 234 2 2001 > 334 2 ...
0
votes
1answer
28 views

Adding error bars to grouped bar plot in pandas

I'm generating a plot in pandas by first generating the following DataFrame: plotData=resultData.groupby(['student_model','lo_id']).describe().nShots.unstack().reset_index() plotData['se'] = ...
1
vote
1answer
27 views

How to draw bar in python

I want to draw bar chart for below data: 4 1406575305 4 4 -220936570 2 4 2127249516 2 5 -1047108451 4 5 767099153 2 5 1980251728 2 5 -2015783241 2 6 -402215764 2 7 927697904 2 7 ...
0
votes
1answer
21 views

Plot bar chart from nested dictionary

How can I plot a bar chart from a nested dictionary such as this? { Weekly: { 'Gas': '65.22', 'Electricity': '120.01' }, Monthly: { 'Gas': '171.05', ...
2
votes
1answer
31 views

Can matplotlib errorbars have a linestyle set?

Is is possible to set the same linestyle to matplotlib errorbars than to the datapoints linestyle? In the example below, two lines are plotted, one of them is dashed because of the ls='-.' ...
0
votes
1answer
25 views

Plotting with more colors in matpltlib

I am trying to plot a scatter plot using matpltlib, i am getting " IndexError: pop from empty list" error and I am not sure how to fix it. import matplotlib.pyplot as plt import matplotlib import ...
3
votes
1answer
29 views

Annotating gracefully pandas plot with texts that do not overlap

I have the below pandas dataframe containing some events and a count that i'm looking to plot and annotate with event details in the chart: Date Time Time Zone Currency Event Importance ...
1
vote
0answers
17 views

Matplotlib colorbar forces a centered axis to be left aligned

When I use matplotlib colorbars it seems to take what would have been a centered axis and force it to become left align. I'm adding a colorbar like this: def colorbar(scalars, colors): """ ...
1
vote
2answers
37 views

Numpy fft result is unexpected

I used fft.fft(data) and plotted that result I was expecting to the frequency that I gave in data. I was expecting to see 50 hz but I got something strange. import numpy as np import math as m import ...
3
votes
1answer
26 views

Different behaviour of hexbin and histogram2d

What is the difference between hexbin and histogram2d? f, (ax1,ax2) = plt.subplots(2) ax1.hexbin(vradsel[0], distsel[0],gridsize=20,extent=-200,200,4,20],cmap=plt.cm.binary) H, xedges, yedges ...
0
votes
3answers
22 views

Imshow aspect doesn’t work well

I make numeric simulations and have problems with my plots... My simulation area is 6x35µm with a resolution of 640x1024px. When I want to plot my simulation data using imshow, and set the aspect ...
2
votes
0answers
21 views

mpl data error with cx_freeze - Linux 13.10

I am new on stack overflow and I hope I am not asking something obvious. In fact, I did quite a search online and I could not find a proper answer/solution to my problem. I am building an open-source ...
2
votes
1answer
30 views

Display multiple mpld3 exports on a single HTML page

I've found the mpld3 package to be brilliant for exporting a matplolib plot to HTML and displaying this via a flask app. Each export comes with a lot of JS which seems unnecessary duplication if you ...