Tagged Questions
0
votes
0answers
4 views
Change resolution of Matplotlib Figure window when saving plot?
I'm using Windows XP v3/Python 2.7 with Canopy and Anaconda package managers/editors.
I am using Python/Matplotlib to produce some Bland-Altman plots (statistical scatter plots) for publication.
...
0
votes
1answer
25 views
Pandas (python) plot() without a legend
Using the pandas library in python and using
.plot()
on a dataframe, how do I display the plot without a legend?
2
votes
0answers
18 views
In python using matplotlib how to display multiline strings in ax.fmt_xdata
I'm using matplotlib version 1.2.0 and python 2.7 on linux.
plot(numpy.arange(10))
ax = gca()
ax.fmt_xdata = lambda x: "line1 %d\nline2 %f"%(int(x),x)
On linux using the Qt4Agg backend it does ...
0
votes
0answers
10 views
mpl_toolkits.basemap import Basemap not working in TextMate but works on command prompt
I am trying to use the Basemap mapping utility in Python. I've installed all the dependencies and if I try it on the command prompt it works fine:
x-134-84-134-83:~ james$ python
Python 2.7.6 ...
1
vote
2answers
24 views
Purpose of 'ax' keyword in pandas scatter_matrix function
I'm puzzled by the meaning of the 'ax' keyword in the pandas scatter_matrix function:
pd.scatter_matrix(frame, alpha=0.5, figsize=None, ax=None, grid=False, diagonal='hist', marker='.', ...
2
votes
1answer
20 views
Pandas Dataframe Bar Plot - Qualitative Variable?
I am looking to create a simple bar plot, where the grouped qualitative values for "source" are the x-axis and the quantiative values of "retweet_count" are the y-axis.
I want the total number of ...
0
votes
1answer
15 views
Stani's python editor unable to plot contour [on hold]
I'm using the following:
Ubuntu 12.04;
SPE editor 0.8.4.h;
Python Version 2.7.3;
wxPython version 2.8.12.1
I have written a small script in Python that plots a contour. Please find the script below:
...
1
vote
1answer
25 views
How to put text inside a box on a plot in matplotlib
I'd like to put a text inside a box on a matplotlib plot, but the documentation gives only example on how to put it in upper right corner (and choosing different corner is not exactly ...
0
votes
1answer
22 views
Trying to print out the decision tree for a forest from scikit-learn ensemble
I am trying to print out the decision tree for a forest from scikit-learn ensemble: For example for a DecisionTreeClassifier, I would use:
from sklearn import tree
clf = ...
1
vote
1answer
37 views
scipy.polyfit(x, y, 100) would be 100th order polynome, but matplotlib.pyplot.legend displays 53?
I'm having a hard time figuring out why my plt.legend displays the wrong polynome degree. It says 53 instead of 100. My code would go like this:
import scipy as sp
import numpy as np
import urllib2
...
0
votes
1answer
22 views
Log x-scale in imshow :: matplotlib
I have a table which looks like this
I have the highlighted part as a matrix of which I want to do an imshow. I want to have the x-scale of the plot logarithmic, as one can understand by looking at ...
1
vote
1answer
45 views
matplotlib scatter works in ipython notebook, but not console
I'm trying to learn to use matplotlib and am following a tutorial to draw a scatterplot where I specify the size of the points. (http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.scatter)
...
0
votes
0answers
10 views
Scitools error related to Matplotlib
I am trying to run a Python script that uses Scitools. However, I am getting such strange error:
No support for meshc/surfc in Matplotlib.
Have anybody seen that before? Maybe it is connected to ...
3
votes
0answers
56 views
Matplotlib & Numpy incompatibility with some Pandas functions? - integer is required
First of all, I am using '2.7.3 | 64-bit, pandas 0.12.0, and numpy 1.8.0. I am following this tutorial on Pandas time series, however when I get to this:
...
-1
votes
0answers
18 views
real time plotting of multiple data series using matplotlib
I have an application that does real time plotting for one data series, but i would like to be able to plot multiple data series in real time in different windows using matplotlib. i was wondering if ...
0
votes
1answer
15 views
Matplotlib: plotting time seconds are floats
I have created a couple of graphs using matplotlib.
X-axis always contains time and Y-axis a given value.
The graphs were created as follows:
fig = plt.figure(1)
ax = fig.add_subplot(111)
...
1
vote
1answer
17 views
Matplotlib labels/titles disappear when exporting in eps format
I'm trying to save a matplotlib figure in eps format, but when I use savefig(), the labels and titles all disappear. It works fine with every other type of output, so I'm not sure what's going wrong.
...
2
votes
0answers
34 views
Placing the legend outside the plot
I want to position the legend outside the drawing box. I do not find a clean way to do this. The main problem is having everything fit on the file saved. The only thing I have been able to figure out ...
1
vote
1answer
23 views
How can I update a matplotlib figure in a way that prevents xdata from being None?
I’m writing an application that periodically (approximately once per second) collects some data from a hardware device and displays it in a graph using matplotlib. The user will periodically click on ...
0
votes
1answer
39 views
How can I set the color for all aspects of an axis at once?
I'd like to set the color of major and minor ticks, tick labels, and the axis itself all to the same color, but the only way I've come up with to accomplish this is something like
fig, ax_a_mj = ...
1
vote
0answers
30 views
Am I over-specifying the positioning of my 'matplotlib' annotations?
I want to be able to specify a relative position for callout labels on data points in my matplotlib plots using basic compass orientations ('NW', 'E', etc.)
and have written some code that works; ...
1
vote
1answer
65 views
converting stft to chroma and plotting the result
I am trying to convert stft of a wav file into chromagram.
Here's my code :-
def stft(x,fs,framesize,hopsize):
frame = int(framesize*fs)
hop = int(hopsize*fs)
w = scipy.hamming(frame)
...
0
votes
1answer
25 views
Adding legend to complex plot made with mpmath
I've been using the cplot command from the mpmath library to plot a complex function. It works pretty easily, all I have to do is write cplot(G_fit, [0.001, v_max], [-v_max, v_max], points = 100000) ...
0
votes
2answers
29 views
Mismatch with scikit-learn fit() method when trying to plot data set from csv instead of generating it
Originally I uses an scikit-learn snipit to generate my data set:
# Create a random dataset
rng = np.random.RandomState(1)
X = np.sort(5 * rng.rand(80, 1), axis=0)
y = np.sin(X).ravel()
y[::5] += 3 * ...
0
votes
1answer
41 views
Plotting data contained in .mat file with python
I have a file myfile.mat exported from octave, it contains three matrices X, Y, U all of them have same size and I want to plot surface U where X, Y are the x and y components of surface U. I can do ...
0
votes
2answers
69 views
+50
colorbar showing two sets of labels
I have an imshow plot in Python with a colorbar.
I wanted to position my colorbar in a certain place and have the orientation horizontal, and so I have the following:
cbaxes0 = fig.add_axes([0.65, ...
0
votes
1answer
35 views
Creating a stand alone GUI which shows interactive matplotlib figures
I'm looking to build a stand-alone tool (preferably EXE) that will take on a text file of specific format and plot it's content in a figure. The exe will launch a GUI in which the user will have to ...
0
votes
1answer
50 views
Fast increment of many sub-spans of an array
Is anyone familiar with a faster way to increment spans of indexes, as done by the following patch(ar, ranges)? In other words, it counts overlapping ranges, somewhat like a histogram. Maybe there is ...
0
votes
1answer
29 views
Fill continents but still visible data overlay
I've made a plot using matplotlib, it can visualise my data, but to add some more detail I would like to fill the continents with one colour so people can distinguish land from ocean.
But if I add ...
0
votes
2answers
35 views
ValueError: invalid literal for int() with base 10: '' Python / Matplotlib
I am trying to create a graph and be able to edit it. When I call the graphExample, I receive the error message. Can anyone please advise? Thanks.
import matplotlib.pyplot as plt
def ...
1
vote
1answer
25 views
Adding color bar to a table matplotlib
I have the following code for making a table plot in matplotlib.
fig = plt.figure(figsize=(15,8))
ax = fig.add_subplot(111, frameon=True, xticks = [], yticks = [])
tb = plt.table(cellText = ...
1
vote
1answer
37 views
Is there a tutorial for creating a hexbin heat map using Matplotlib? [closed]
I'm trying to learn how to do a heatmap in Python using matplotlib. I'm going to be plotting a series of locations in a huge X,Y grid based off of an array of tuples. I found this code example which ...
3
votes
2answers
70 views
Default fonts in Seaborn statistical data visualization in iPython
After multiple problems trying to run stanford.edu/~mwaskom/software/seaborn/ in Anaconda and Enthought for Mac (many problems with dependencies and versions), I was able to run it from an Enthought ...
1
vote
0answers
39 views
What are 'matplotlib' “figure points” and how are they determined?
Though this is probably an elementary question, I'm having trouble finding an answer (the search terms aren't helping, since they generate a lot of false hits): what are 'matplotlib' "figure points" ...
0
votes
1answer
28 views
How can I animate this code? figure loads then crashes and says 'this program is not responding'
I am trying to animate some code I wrote which would model the gravitational attraction between N particles (in this case two colliding galactic clusters), I had it working fine plotting out the paths ...
1
vote
0answers
59 views
Using Python and Pandas to generate trends from indicators
I'm trying to determine what kinds of corrections a market makes in response to changes.
A simple version of this using Python, Pandas and matplotlib might look like:
from pandas import *
ts = ...
2
votes
1answer
36 views
Matplotlib dependent sliders
I want to choose a point of a triangle by choosing its weights. This should be done by controlling 2 Sliders (matplotlib.widgets.Slider). These two sliders express two out of three weights that define ...
1
vote
1answer
26 views
Contour Paths Occasionally Empty
I've been trying to get the perimeters and areas of a bunch of contours (I'm using a level-set method to model burnback in solid/hybrid rocket motors). I've taken the approach recomended here:
...
0
votes
0answers
41 views
Installing Matplotlib via pip on Mac OS X Mavericks failing due to Coacoa error?
I've been wrestling with getting the matplotlib library installed for python for a few days now. I've got freetype, XCode, X11, and the bindings sorted out, but now when I try to install matplotlib I ...
0
votes
1answer
26 views
Creating movie from a series of matplotlib plots using matplotlib.animation
I have a script which generates a series of time dependent plots. I'd like to "stitch" these together to make a movie.
I would preferably like to use matplotlib.animation. I have looked at examples ...
1
vote
1answer
31 views
How do to tighten the bounds of my 'matplotlib' figures to be closer to my axes?
When matplotlib makes figures, I find that it "pads" the space around axes too much for my taste (and in an asymmetrical way). For example with
import numpy as np
import matplotlib.pyplot as plt
fig ...
1
vote
1answer
25 views
Why is 'matplotlib' failing to find certain font weights for a specified font?
I'm having trouble getting matplotlib to find specific fonts that I know are installed on my system and that show as available according to matplotlib.font_manager. When I specify certain weights for ...
1
vote
1answer
100 views
_tkinter.TclError: no display name and no $DISPLAY environment variable for new OS X Mavericks
This is my first post so please be forgiving.
I am trying to create an animation using matplotlib, and I could do this perfectly well until a few days ago, until I upgraded to OS X Mavericks, upon ...
0
votes
0answers
61 views
3D Real time continuous plot using Python
I know this may be an old topic, I have searched through a lot of related topics on Google but haven't really found useful information. I am trying to get data from a microcontroller board and plot ...
1
vote
1answer
29 views
Strange response to font settings in 'matplotlib'
I have a variety of fonts installed on my system (OS X 10.9.1), and am able to use them all with no problems in all of my tools and applications (including my LaTeX installation) but my attempts to ...
1
vote
0answers
27 views
How do I get 'matplotlib' to use my LaTeX sans font by default
I'm trying to generate figures using matplotlib in which all of the text is sans-serif (Open Sans) by default. A number of questions here on SO, along with the Open Sans documentation, suggest ...
0
votes
1answer
44 views
Sloppy SVG generated by matplotlib resulting on poor clipping of datapoint drawing in figures
Figures that I create with matplotlib do not properly clip points to the figure axes when rendered, but instead draw additional points, even though such figures look fine in some viewers.
For example ...
-2
votes
1answer
45 views
How to create a simple pie chart using python
Ive been trying to generate a simple pie chart using python just using two variables. representing percentages.I always encounter an error "vcvarsall.bat" not found upon installing matplotlib ...
2
votes
1answer
34 views
Matplotlib: plotting data labels on data connected to parasite axis
This is a variation on the 'how to I plot data labels' question I've seen a few places on SO. But, I've never seen it done on a parasite axis.
Basically, I want data labels above each point for the ...
0
votes
1answer
47 views
Plotting date in Pandas independent of year
I have a dataframe that contains orders, and the day each order took place, allowing multiple orders per day. I've managed to plot the number of orders by day in dataframe df with:
...