Tagged Questions
1
vote
1answer
36 views
Basic example for PCA with matplotlib
I trying to do a simple principal component analysis with matplotlib.mlab.PCA but with the attributes of the class I can't get a clean solution to my problem. Here's an example:
Get some dummy data ...
0
votes
0answers
26 views
Getting individual outlier points using sci-kit
I am using sci-kit's example of detection of outliers on a real data set to detect outliers on particular data. I am interested in figuring out how to get the individual points that are outliers in a ...
0
votes
1answer
37 views
Python Histogram using matplotlib
I've written a python script that parses a trace file and retrieves a list of objects (vehicle objects) containing the vehicle id, timestep and the number of other vehicles in radio range of a ...
-2
votes
0answers
49 views
Plot an exponentially decaying function in python [on hold]
I have some integer time values in sorted order. At each time value I add one to the y value and the function decays exponentially with half life 1. How can I plot this function in python?
As an ...
0
votes
2answers
52 views
Matplotlib: using a figure object to initialize a plot
I am building a class of plot tools for a specific experiment.
I currently have two plot methods, a static plot using imshow(), and a "movie" format also
using imshow() .
Both methods and any future ...
0
votes
1answer
59 views
words as y-values in pyplot/matplotlib
I am trying to learn how to use pylab (along with the rest of its tools). I'm currently trying to understand pyplot, but I need to create a very specific type of plot. It's basically a line plot with ...
-1
votes
1answer
69 views
ImportError: matplotlib requires dateutil
I have successfully installed matplotlib with python 2.6 on x64 Windows7. When I try to import matplotlib, it shows the following error. I have also installed numpy following this link: Installing ...
1
vote
0answers
81 views
Principal Component Analysis with numpy and matplotlib
I have an array, representing this kind of tables:
And I am trying to get a result through PCA, which Elements(e1,e2,e3) are similar to each other, which Concerns(c1,c2,c3) are similar to each ...
0
votes
0answers
19 views
Matplotlib Figure Editor with QT4
I'm building a GUI using Python 2.7, Matplotlib version 1.2.1, QT4 4.9.6. The goal is to be able to load images, rescale them, and perform other small manipulations. Since I'm porting the GUI from a ...
0
votes
1answer
26 views
drawing line on scatter graph in python
I have some code that plots data points on a scatter graph and draws two lines on it. I want the lines to go to the edge of the plot so they create a box in the top left corner containing some of the ...
2
votes
1answer
63 views
multiple imshow-subplots, each with colorbar
I want to have a figure consisting of, let's say, four subplots. Two of them are usual line-plots, two of them imshow-images.
I can format the imshow-images to proper plots itself, because every ...
0
votes
0answers
38 views
latex failure ipython daft matplotlib
I was keen to try out daft (http://daft-pgm.org/) and through it I found out that latex functionality was not working in matplotlib.
I paste the example on the daft website ...
2
votes
1answer
49 views
Embed an interactive 3D plot in PySide
What is the best way to embed an interactive 3D plot in a PySide GUI? I have looked at some examples on here of 2D plots embedded in a PySide GUI:
Getting PySide to Work With Matplotlib
Matplotlib ...
0
votes
1answer
27 views
Multiple Plots in Matplotlib Widget
I have designed a relatively large application but I am facing a problem in implementing the Matplotlibwidget graphs. This is the snippet of code where I am handling the graph.
The following code ...
0
votes
1answer
22 views
How can I remove xtics from an axis in matplotlib?
I'm using subplots in matplotlib. Since all of my subplots have the same x-axis, I only want to label the x-axis on my bottom plot. How can I remove xtics from just one axis?
0
votes
0answers
50 views
Python matplotlib memory clog (not clearing)
I have a problem with matplotlib not clearing memory (I assume). I've tried looking around on Google but to no avail. I'd like the memory to clear each time after I close matplotlib figure (which is ...
0
votes
0answers
22 views
How to to embed matplotlib.pyplot in wxpython? [duplicate]
I made me a litle graph builded with matplotlib.
import matplotlib.pyplot as plt
plt.plot([1,2,3], [1,4,9], label='going up')#, color="red")
plt.plot([1,2,3],[1,2**3, 3**3], label='going down') ...
-1
votes
0answers
19 views
building matplotlib with pyinstaller 2.0
I am trying to use pyinstaller 2.0 to build an .exe file from a python script which uses matplotlib and numpy, but I keep failing. I tried this code from
Building python pylab/matplotlib exe using ...
2
votes
1answer
25 views
python matplotlib plot hist2d with normalised masked numpy array
I want to plot 2d histogram using matplotlib.pyplot.hist2d. As input I have masked numpy.ma arrays. That as such works fine like this:
hist2d (arr1,arr2,cmin=1)
However if I want to normalise the ...
1
vote
2answers
60 views
Pandas Tick Data Averaging By Hour and Plotting For Each Week Of History
I have been following the answer here:
Pandas: how to plot yearly data on top of each other
Which takes a time series and plots the last data point for each day on a new plot. Each line on the plot ...
2
votes
1answer
146 views
How to produce plot with text as ytick labels
I am just getting to know the Python libraries pandas and matplotlib. Can you show me as an example how to produce a plot similar to this one with matplotlib:
On the y-axis to the right the names ...
3
votes
2answers
338 views
How do I write a Latex formula in the legend of a plot using Matplotlib inside a .py file?
I am writing a script in Python (.py file) and I am using Matplotlib to plot an array.
I want to add a legend with a formula to the plot, but I haven't been able to do it.
I have done this before in ...
1
vote
2answers
155 views
Avoid coinciding lines and markers in pyplot
I have two problems which are based on a similar fact. If I use Matplotlib to plot lines which happen to lie on one another partly in that specific area only one of them is shown.
Example one
import ...
3
votes
1answer
577 views
How can I save this matplotlib figure such that the x-axis labels are not cropped out?
I am running the following snippet of code in the ipython notebook, using the pandas data analysis library along with matplotlib.pyplot.
titles = {'gradStat_p3': "P3: Gradiometers", 'magStat_p3': ...
0
votes
2answers
211 views
.EXE installer crashes when installing Python modules: IPython, Pandas and Matplotlib
I recently installed Numpy with ease using the exe installer for Python 2.7. However, when I attempted to install IPython, Pandas or Matplotlib using the exe file, I consistently get a variant of the ...
41
votes
2answers
32k views
matplotlib save plot to image file instead of displaying it (so can be used in batch scripts for example)
I am writing a quick and dirty script to generate plots on the fly. I am using the code below (from matplotlib docs) as a starting point:
from pylab import *
from optparse import OptionParser
# make ...
7
votes
1answer
2k views
How can I display text over columns in a bar chart in matplotlib?
I have a bar chart and I want over each column to display some text,how can I do that ?
20
votes
2answers
23k views
Matplotlib make tick labels font size smaller
In a figure with matplotlib I would like to make the font size for the tick labels using
ax1.set_xticklabels(
smaller. How can I?
And last part, how can one rotate it from horizontal to vertical ?
...
12
votes
2answers
7k views
Save a subplot in matplotlib
is it possible to save (to a png) an individual subplot in a matplotlib figure? Lets say I have
import pylab as p
ax1 = subplot(121)
ax2 = subplot(122)
ax.plot([1,2,3],[4,5,6])
...
4
votes
2answers
3k views
Creating a Colormap Legend in Matplotlib
I am using imshow() in matplotlib like so:
import numpy as np
import matplotlib.pyplot as plt
mat = '''SOME MATRIX'''
plt.imshow(mat, origin="lower", cmap='gray', interpolation='nearest')
plt.show()
...