Tagged Questions
0
votes
1answer
13 views
Using a Pandas dataframe index as values for x-axis in matplotlib plot
I have time series in a Pandas dateframe with a number of columns which I'd like to plot. Is there a way to set the x-axis to always use the index from a dateframe?
When I use the .plot() method from ...
0
votes
1answer
10 views
Different colors for each line in the graph
I am trying to plot some data from a file. The file contains 13 columns, but i want just the first and the fourth column to plot. Also, there are more than one of the file, i want to plot them on the ...
0
votes
0answers
7 views
How to annotate a point in a subplot, and highlight it in the adjacent subplot in matplotlib
I want to create a reduced scatter plot matrix which will be composed by three subplots (like the one in this link Is there a function to make scatterplot matrices in matplotlib?). I have extracted ...
2
votes
1answer
13 views
Drawing a 2D function in matplotlib
Dear fellow coders and science guys :)
I am using python with numpy and matplotlib to simulate a perceptron, proud to say it works pretty well.
I used python even tough I've never seen it before, ...
3
votes
2answers
29 views
Pythonic way of detecting outliers in one dimensional observation data
For the given data, I want to set the outlier values (defined by 95% confidense level or 95% quantile function or anything that is required) as nan values. Following is the my data and code that I am ...
0
votes
0answers
6 views
Show image in 3D matplotlib ax
with python and matplotlib, I can show a 3d surfaces
from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
from matplotlib import cm
fig = plt.figure()
ax = ...
0
votes
0answers
13 views
Pylab - diaporama of plots
I've many datasets I want to look at one by one in an incoherent order. For so I'm coding a small python script that could give me a diaporama of plot: plotting one, waiting x seconds plotting a ...
0
votes
0answers
14 views
Upright mu in plot label: retaining original tick fonts
I have a problem which I thought would be more occurring. However, after scouring the internet for some time now I have not been able to find the solution to my problem. So here it goes:
For a plot, ...
2
votes
1answer
16 views
Matplotlib legend for an arrow
I would like to know how it is possible to label an arrow and show it in the legend of a plot.
For instance if I do this
arrow(0,1,'dummy',label='My label')
legend()
I do not see anything in ...
0
votes
1answer
17 views
issue plotting too many lines on curve fit with matplotlib
not sure what I'm doing wrong, but when I try and implement the polyfit to scatterplot data (year, rating) it keeps plotting a whole bunch of lines rather than one single line. It looks like this:
...
0
votes
1answer
14 views
Plotting a Discriminant Function for Normal Densities via Matplotlib
I want to plot the general discriminant function for normal densities for some random data. I have no idea how I would go about it via matplotlib, I hope anyone could help me a little bit.
The ...
0
votes
1answer
15 views
Plotting two objects using a 4-item list
I have this simulator (gravitation) I've been working on, and I've dissected the equations, math, etc. and it's totally legitimate. However, when I animate the thing I get weird behavior. I'd rather ...
-1
votes
0answers
21 views
Graph in different colour according to classification
I have a CSV. Each row corresponds to a different item. Each item is a class of either 0 or 1.
I have a column in my CSV which represent the "category" of an item. I am trying to graph this in a ...
0
votes
1answer
30 views
Generating perfect random gaussian numbers
I tried to generate the series of random numbers with gaussian distribution. So, I used numpy.random.normal(mean,standard deviation,size). However, when I converted these numbers into probabability ...
0
votes
1answer
23 views
matplotlib subplots with variable width/data limits
I am using pandas and matplotlib to plot data from an experiment involving 5 sessions. I would like the data for each session to be displayed in a separate panel; I am attempting to use subplotting to ...
0
votes
0answers
12 views
Animating a line joining points in 3D
I'm currently working on a physics assignment, my knowledge of python doesn't extend much beyond a few university modules. I've started working with matplotlib.animation but am fairly new to this ...
1
vote
1answer
14 views
Apache hangs with Django / Matplotlib app
new StackOverflow user here. I need help with an Apache freezing problem. I have a WAMPServer setup on Win 7 64-bit and am working with python / django / mysql / mod_wsgi / matplotlib, experimenting ...
2
votes
0answers
19 views
matplotlib: display xticklabels 'groups' [duplicate]
Is there a way to show a group of xlabels are in the same group? Like the 'Group A' and 'Group B' labels as shown in the figure below.
The closest solution I can find is additional xaxis on top ...
0
votes
2answers
20 views
Vertical Histogram in Python and Matplotlib
How can I make a vertical histogram. Is there any option for that or should it be built from the scratch? What I want is the upper graph to look like the below one but on vertical axis!
from ...
1
vote
1answer
17 views
how to plot in matplotlib with repitative values in a column
I have a csv file with 8 columns in it. I want to plot a graph between 2 columns using matplotlib. One of the columns has repetitive values. I want to take the mean of the values from the other column ...
1
vote
1answer
21 views
Matplotlib: Customizing Qt4Agg Backend
I am trying to customize the Qt4Agg backend. To ensure that I didn't insert any bugs, as a starting point, I copied matplotlib/backends/backend_qt4agg.py to a new location on my PYTHONPATH, renamed ...
0
votes
2answers
30 views
Matplotlib transparent overlay & pdf transparency
Let's assume I have two numpy arrays (The ones I present are just examples):
import numpy as np
A = np.arange(144).reshape((12, 12))
np.random.shuffle(A)
B = np.ones((12,12))
B[0:10:4,:] = None
I ...
2
votes
0answers
11 views
Extract numerical values from zfilter object in python in AudioLazy library
I'm using AudioLazy Library for the extraction of some audio features.
The lpc function (Linear Predictive Coding) receives a block in the time domain, and returns the whitening LPC filter (ZFilter)
...
1
vote
0answers
12 views
ImportError: No module named _gdbm matplotlib pickle
since matplotlib 1.3 matplotlib figures are pickle-able
When I try an example found on stackoverflow:
import matplotlib.pyplot as plt
import numpy as np
import pickle
ax = plt.subplot(111)
x = ...
0
votes
1answer
18 views
Matplotlib figures
I am currently creating an animation of an oscillating graph in matplotlib (mpl) in a TKinter framework. I currently use the code:
self.f = plt.Figure()
self.canv = FigureCanvasTkAgg(self.f, ...
0
votes
0answers
18 views
3d plot of custom function with matplotlib
I need to do a 3d plot with python. In the documentation there are not example that I can use.
Here my code:
f0=interp1d(t1,sig1,kind="cubic",bounds_error=False,fill_value=0)
...
1
vote
0answers
3 views
Hatch fill between while exporting in eps in matplotlib?
In matplotlib while I got error while I was trying to shade few overlapping bands with various hatches (fill_between) and to export in eps format. Is there a solution, keeping the vector format ...
1
vote
1answer
16 views
Matplotlib subscript
I know that we can produce a single subscript in matplotlib like
$r_i
will give me an r with "i" as the subscript.
But I want to generate a subscript with say 3 or 4 letters, like r_ijk should ...
1
vote
1answer
12 views
Import a matlotlibrc file?
Simple question - I have a .matplotlibrc file with some defaults (e.g. http://home.strw.leidenuniv.nl/~turnerm/python.html) that I want to import/apply optionally with a simple switch in the code. How ...
0
votes
0answers
12 views
Python installing matplotlib on mac with pip
I was trying to use pip to install matplotlib and I keep getting this error:
Python 2.7.5 (v2.7.5:ab05e7dd2788, May 13 2013, 13:18:45)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type ...
-1
votes
2answers
23 views
Has stackplot been removed from the matplotlib library?
Just been reading about .stackplot after trying to replicate this chart type using Pandas, IPython and Seaborn.
http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.stackplot
I've read about ...
1
vote
0answers
13 views
strange box in legend of output of bargraph with Python and Matplotlib
I am more or less a hobby programmer and found that python and matplotlib create some nice outputs.
I am attempting to analyze a comma separated output and display data.
I was able to get my data from ...
0
votes
1answer
18 views
How to show cycles in networkx graph drawing
I have a simple graph constructed using NetworkX as follows:
import networkx as nx
import matplotlib.pyplot as plt
G = nx.DiGraph()
G.add_edges_from([(0,1), (0,2), (1,1), (1,2)])
nx.draw_networkx(G)
...
0
votes
0answers
13 views
Setting the absolute position of a figure using python matplotlib with the MacOSX backend
Is it possible to set the absolute position of a figure on the screen using matplotlib with the MacOSX backend?
This answer
How do you set the absolute position of figure windows with matplotlib?
...
1
vote
1answer
19 views
Matplotlib Bar Chart Choose Color if Value is Postive vs Value is Negative
I have a Pandas DataFrame with positive and negative values as a bar chart. I want to plot the positive colors 'green' and the negative values 'red'(very original...lol). I'm not sure how to pass ...
2
votes
0answers
19 views
Showing updated plot at every step with matplotlib's plot_directive
I am using Matplotlib's plot_directive Sphinx extension, and have something like:
.. plot::
:context:
:include-source:
import matplotlib.pyplot as plt
fig = plt.figure()
ax = ...
0
votes
1answer
14 views
matplotlib pie charts leave labels from previous pie chart
I have a small Django app that produces two different pie charts.
But the labels from the first chart that's displayed reappear in
the second chart.
I'm just using:
plt.pie(...)
plt.savefig(...)
...
-1
votes
1answer
15 views
Gtk* backend requires pygtk to be installed
From within a virtual environment, trying to load a script which uses matplotlib's GTKAgg backend, I fail with the following traceback:
Traceback (most recent call last):
File "<stdin>", line ...
2
votes
2answers
35 views
words frequency using pandas and matplotlib
How can I plot word frequency histogram (for author column)using pandas and matplotlib from a csv file? My csv is like: id, author, title, language
Sometimes I have more than one authors in author ...
2
votes
1answer
15 views
Use MatPlotLib to plot line graph with error ranges around points
I'm trying to plot a line graph of ten values with error ranges over each point:
u = [1,2,3,4,5,6,7,8,9,10]
plt.errorbar(range(10), u, yerr=1)
plt.show()
I get the error message
ValueError: too ...
0
votes
1answer
17 views
Converting a script which calls another into one .exe application
I am trying to convert my python scripts into an executable.
I have two .py files. The first produces a GUI (using pyqt4) to choose a csv file and select some settings. It calls another .py script ...
0
votes
0answers
12 views
Event handling for matplotlib figure inside a WxPython panel
How to do event handling on a matplotlib figure which will be inside a notebook or an example like this?
from numpy import arange, sin, pi
import matplotlib
matplotlib.use('WXAgg')
from ...
0
votes
1answer
18 views
Matplotlib does not work with Canopy 1.3 on Linux Mint Debian Edition
I recently upgraded to Canopy 1.3 on my Linux computer, and since then I am experiencing problems when trying to use Matplotlib. I did not have these problems with Canopy 1.1.
Invoking Matplotlib ...
5
votes
3answers
60 views
+150
Plotting a decision boundary separating 2 classes using Matplotlib's pyplot
I could really use a tip to help me plotting a decision boundary to separate to classes of data. I created some sample data (from a Gaussian distribution) via Python NumPy. In this case, every data ...
0
votes
0answers
27 views
Matplotlib equivalent of Matlab's cellplot()
There is a cellplot() function in Matlab which visualizes the contents of a cellarray. I would like to visualize the contents of a Python tuple in similar manner. Is there a function in Matplotlib or ...
1
vote
0answers
32 views
Calculating and Plotting 2nd moment of image
I am trying to plot the 2nd moments onto a image file (the image file is a numpy array for brightness distribution). I have a rough understanding that 2nd moment is sort of like moment of inertia ...
1
vote
1answer
27 views
Display image within Matplotlib plot between given XY bounds
I have implemented a numerical model from a journal paper and want to plot my version over a screenshot of a graph from the journal paper pdf using Python and Matplotlib. I took a screenshot of the ...
0
votes
1answer
26 views
add text to pandas dataframe plot
I am plotting a dataFrame and I want to add information about the information (mean and std of the data)
I am plotting the data this way:
df = pd.DataFrame({'type': lifeExpExcel['Country'], 'Infant ...
3
votes
1answer
35 views
Reading and manipulating multiple netcdf files in python
I need help with reading multiple netCDF files, despite few examples in here, none of them works properly.
I am using Python(x,y) vers 2.7.5, and other packages : netcdf4 1.0.7-4, matplotlib 1.3.1-4, ...
1
vote
1answer
25 views
Distributing a pandas DataFrame feature at random
I am reading in a set of data using pandas and plotting this using matplotlib. One column is a "category", eg "Sports", "Entertainment", but for some rows this is marked "Random", which means I need ...