Tagged Questions
0
votes
0answers
14 views
How to translate this python pylot bar plot to gnuplot code
I need draw a bar plot with 200k data points. I have matplotlib.plot code, which runs well for small data set, but too slow for 200k points.
Can anyone help me translate this python code to gnuplot? ...
1
vote
0answers
24 views
Sizing matplotlib savefig output to underlying image
Im plotting some lines over a bitmap image in matplotlib. How do I make the image output by savefig the same size as the original image? I have the following code, but it still gives me a white border ...
1
vote
0answers
42 views
Constructing high resolution images in Python
Say I have some huge amount of data stored in an HDF5 data file (size: 20k x 20k, if not more) and I want to create an image from all of this data using Python. Obviously, this much data cannot be ...
2
votes
0answers
27 views
Python Matplotlib 3D line appearing through surface
I am using a mapping to convert points on the surface of a cube to a sphere.
I want to plot the surface of the resulting sphere and lines where the edges of the cube are mapped.
So far, I have tried ...
0
votes
0answers
23 views
Why does the NetworkX graph not draw in Cygwin?
I am running Python and NetworkX (a graphing library) on Cygwin (Windows 7).
The following code creates a graph and attempts to draw it - but nothing appears on screen:
plt.ion()
...
1
vote
1answer
24 views
Vertical line not respecting min,max limits (matplotlib)
Minimal working example of the issue:
import matplotlib.pyplot as plt
horiz_line = 0.0005
vert_line = 110
x_data = [10, 30, 50, 70, 90, 110, 130, 150, 170, 190, 210, 230, 250, 270, 290, 310, 330, ...
0
votes
1answer
20 views
matplotlib empty legend handles
I wanted to add some text to a legend in a matplotib plot in python. I was thinking about creating an empty handle, is there any way to do it? Already tried by using somethin similar to:
...
-1
votes
0answers
36 views
How to plot space time cube in matplotlib? [closed]
I have data in the format of (timestamp,lattitude,longitude) and would like to plot this as a space time cube in python. I tried pyprocessing but there is an issue with pyglet installation on ubuntu ...
0
votes
0answers
28 views
Matplotlib: scatter plot - symbol size based on pixel distance
Suppose I wanted to automatically select the size for square symbols in a scatter plot to make the borders align (a question like that has been asked).
In my answer to that question, I suggested ...
0
votes
0answers
34 views
How to plot line as surface with matplotlib
I have a few data lines, let's say:
DATA = dict()
DATA[2] = (
[-4, -2, 0, 2, 4, 6, 8, 10], # X
[2.6390e-01, 2.1350e-01, 1.5854e-01, 1.0401e-01, 5.6534e-02, 2.2940e-02, 5.9655e-03, 7.8050e-04] # Y
)
...
1
vote
1answer
103 views
Setting the size of the plotting canvas in Matplotlib
I would like Matplotlib/Pyplot to generate plots with a consistent canvas size. That is, the figures can well have different sizes to accomodate the axis descriptions, but the plotting area (the ...
2
votes
1answer
127 views
matplotlib candlestick bars/boxes/width/spacing
I am using matplotlib to draw candlestick charts.
[Q] The default setting shows the high-low bar running through the open-close box. I would prefer to have the open-low box be "above" the line so ...
2
votes
2answers
255 views
Plot different DataFrames in the same figure
I have a temperature file with many years temperature records, in a format as below:
2012-04-12,16:13:09,20.6
2012-04-12,17:13:09,20.9
2012-04-12,18:13:09,20.6
2007-05-12,19:13:09,5.4
...
9
votes
2answers
1k views
matplotlib wont draw python3
I installed matplotlib successfully inside a virtualenv. Now I'm trying to get it to draw. I know how to change the backend, but I'm having a whole lot of trouble figuring out what to change it to.
...
7
votes
1answer
6k views
How do I set figure title and axes labels font size in matplotlib?
I am creating a figure in matplotlib like this:
from matplotlib import pyplot as plt
fig = plt.figure()
plt.plot(data)
fig.suptitle('test title')
plt.xlabel('xlabel')
plt.ylabel('ylabel')
...
1
vote
4answers
2k views
real-time plotting in while loop with matplotlib
I am trying to plot some data from a camera in real time using OpenCV. However the real-time plotting (using matplotlib) doesn't seem to be working.
I've isolated the problem into this simple ...
2
votes
1answer
1k views
Python: Unable to Render Tex in Matplotlib
I recently upgraded my laptop to Snow Leopard, updated TeX to Version 3.1415926 (TeX Live 2011/MacPorts 2011_5), and installed Python 2.7.3. After all these installs, I ran macport selfupdate and ...
6
votes
1answer
3k views
Python/matplotlib : plotting a 3d cube, a sphere and a vector?
I search how to plot something with less instruction as possible with matplotlib but I don't find any help for this in the documentation.
I want to plot the following things :
- a wireframe cube ...
3
votes
1answer
595 views
How do I plot only weekdays using Python's matplotlib candlestick?
I'm not managing to plot matplotlib.finance.candlestick without the weekends (blank spaces between every 5 candlesticks). The example from Matplotlib's website doesn't exclude weekends either and the ...
6
votes
2answers
7k views
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
I just discovered a logical bug in my code which was causing all sorts of problems. I was inadvertently doing a bitwise AND instead of a logical AND.
I changed the code from:
r = ...
9
votes
3answers
2k views
scipy: savefig without frames, axes, only content
In numpy/scipy I have an image stored in an array. I can display it, I want to save it using savefig without any borders, axes, labels, titles,... Just pure image, nothing else.
I want to avoid ...
5
votes
3answers
482 views
make matplotlib plotting window pop up as the active one
I'm working with python and matplotlib on mac os x.
When I'm working on many different windows and I have to run a script which produces a plot, the plot window always open behind the active window ...
2
votes
2answers
932 views
graphing multiple types of plots (line, scatter, bar etc) in the same window
I'm trying to graph two types of plots in the same window (i.e. a line plot, and a scatter plot). The data being plotted in the line graph (first plot) are floating numerical values representing ...
4
votes
1answer
2k views
automatically position text box in matplotlib
Is there a way of telling pyplot.text() a location like you can with pyplot.legend()?
Something like the legend argument would be excellent:
plt.legend(loc="upper left")
I am trying to label ...
7
votes
3answers
4k views
How do I tell Matplotlib to create a second (new) plot, then later plot on the old one?
I want to plot data, then create a new figure and plot data2, and finally come back to the original plot and plot data3, kinda like this:
import numpy as np
import matplotlib as plt
x = arange(5)
y ...
16
votes
6answers
18k views
Installing MatplotLib in mac osx lion
I was trying to install matplotlib in Mac OSX Lion. Tried to used the binary that is in the sourcefourge site, but I got this error: "matplotlib requires System Python 2.7 to install".
I went to the ...
8
votes
4answers
4k views
Interactive matplotlib plot with two sliders
I used matplotlib to create some plot, which depends on 8 variables. I would like to study how the plot changes when I change some of them. I created some script that calls the matplotlib one and ...
37
votes
3answers
27k views
How to change the font size on a matplotlib plot
How does one change the font size for all elements (ticks, labels, title) on a matplotlib plot?
I know how to change the tick label sizes, this is done with:
import matplotlib
...
1
vote
4answers
4k views
plotting histograms whose bar heights sum to 1 in matplotlib
I'd like to plot a normalized histogram from a vector using matplotlib. I tried the following:
plt.hist(myarray, normed=True)
as well as:
plt.hist(myarray, normed=1)
but neither option produces ...
38
votes
3answers
58k views
Python, Matplotlib, subplot: How to set the axis range?
How can I set the y axis range of the second subplot to e.g. [0,1000] ?
The FFT plot of my data (a column in a text file) results in a (inf.?) spike so that the actual data is not visible.
...