1
vote
1answer
13 views

How to pass a list of pandas columns to a pyplot chart?

Here is my code, which works fine as far as it goes: df = pd.DataFrame({ 'foo' : [1, 2, 7, 2], 'bar' : [3, 1, 3, 2], 'spam' : [5, 2, 1, 0] }) x = range(len(df.foo)) fig, ax = ...
1
vote
0answers
12 views

Set Y labels from a text file - matplotlib

Using matplotlib, I have plotted the following graph from a text file. I have a series of values that are stored in another text file that I want to use the represent the Y axis on this graph. The ...
0
votes
1answer
14 views

Matplotlib varying color x-axis

I am plotting simulator results in matplotlib and would like to be able to have the x-axis changing color depending on a variable. The variable is an indicator if, for each time step in the ...
0
votes
1answer
9 views

Error installing matplotlib on Windows XP computer

I keep getting the following error when I attempt to install matplotlib: raise ValueError(str(list(result.keys()))) valueError: [u' path'] I checked out some of the answers here: error: Unable ...
0
votes
1answer
28 views

How do I find the intersection of two line segments?

Suppose we have two finite line segments defined each by two points (in two space). I would like to find a way to get the intersection point of those two lines. Eventually, I would like to extend this ...
0
votes
1answer
11 views

Compact Matplotlib code( define x,y axis together)

Can I make these lines compact by defining X and Y together in a single line instead of each line for each axis?Thanks, plt.ticklabel_format(style='sci', axis='x', scilimits=(0,0)) ...
1
vote
1answer
34 views

Plancks Formula for Blackbody spectrum

I am trying to write a simple python code for a plot of intensity vs wavelength for a given temperature, T=200K. So far I have this... import scipy as sp import math import matplotlib.pyplot as plt ...
0
votes
2answers
17 views

Adding a colorbar to a polar contourf multiplot

As a follow-up to my previous question, I was wondering what is the proper way of creating multiple polar contourf subplots and add a single color bar to them. I tried this way: import numpy as np ...
0
votes
1answer
11 views

rescale and normalize x axis numbers in python3.2 and matplotlib

I am working in python 3.2 and matplotlib. The numbers of x-axis are between 0 and 1000000. In my plot, the numbers of x-axis are long and overlap each other. I want to re-scale and normalize ...
0
votes
0answers
16 views

No transparency on pdf

I created an image with some transparency as per question in Matplotlib transparent overlay & pdf transparency Now I have an issue when I try to save the image in multipage PDF file where the ...
0
votes
0answers
13 views

Can't fix position of colorbar in image with multiple subplots

I have a very large code which outputs several plots, one for each function it runs. I save all these plots in a single output .png file. Depending on the situation, sometimes the code will save plots ...
1
vote
1answer
63 views

Python 2D plots as 3D (Matplotlib)

Python plot in Matplotlib: I have a number of samples taken daily at the same time which shows a change in measurement (of something). This may be shown as a 2D plot (below left), but as the sample ...
-1
votes
0answers
15 views

plot 10 curves in one figure in python 3.2 by matplotlib

I need to plot 10 curves in one figure in python 3.2 by matplotlib. The curve data is generated in a loop. forloop1 : forloop2 : generate_data_forplot( for a curve) How to do that in ...
0
votes
0answers
6 views

EPS created with matplotlib does not show text correctly

I have a Font problem in eps-files from matplotlib. The font show correctly in die eps file, but when I paste the file in Microsoft Word, it doesnt Show the text (Labels, ticks, title...) I already ...
2
votes
1answer
20 views

Named colors in matplotlib

What named colors are available in matplotlib for use in plots? I can find a list on the matplotlib documentation that claims that these are the only names: b: blue g: green r: red ...
2
votes
2answers
28 views

Resampling a time series of events + duration into concurrent events

I have two columns; the time an event started and the duration of that event. Like so: time, duration 1:22:51,41 1:56:29,36 2:02:06,12 2:32:37,38 2:34:51,24 3:24:07,31 3:28:47,59 3:31:19,32 ...
1
vote
0answers
18 views

Offset value in Matplotlib (Python)

This is the follow up question from this post. Can I define the x-axis as x 10^4 instead of +55478? Some of my data would be more meaningful if it is not factored out. I was planning to post the image ...
0
votes
1answer
27 views

Draw a line through two points of an image python matplotlib

I have an image which I am loading into a 2D array using pyfits. I want to draw a line through two pixels on the image and save it with the new line added (not plot) . After this I want to draw a line ...
0
votes
0answers
30 views

Overlapping gaussians onto 1 gaussian in python

I have been learning python for a few weeks and have just started learning how to manipulate data. I'm currently plotting a number of gaussians using generated data and I want to make these 5 ...
1
vote
1answer
23 views

two output graphs in matplotlib scatterplot animation

I have some code to animate a scatterplot in matplotlib, everything runs smoothly, except that I end up with two output graphs at the end. One contains the desired animation, while the other is blank. ...
0
votes
0answers
10 views

Matplotlib Annotation Update Annotation Position

I am struggling to update the position of an annotation interactively. Using the draggable rectangle example, I have a draggable annotation class that successful allows the user to click an ...
1
vote
1answer
10 views

Plotting for conference posters (increase textsize, linewidth, … at once)

Using pylab (matplotlib) in Python, I'd like to make plots for a scientifc conference poster. However, using a decent dpi resolution and the correct size in inches/centimetres, all elements of the ...
1
vote
1answer
15 views

Matplotlib triangles (plot_trisurf) color and grid

I'm trying to plot a 3D surface with plot_trisurf like this: xs = NP.array([ 0.00062 0.00661 0.02000 0.01569 0.00487 0.01784]) ys = NP.array([ 0.99999 0.66806 0.50798 0.61230 0.83209 ...
-1
votes
0answers
26 views

How to plot multiple bar charts in matplotlib?

i want to display two different bar charts so that the user can compare each bar chart side by side. is there a way that i can do this> i know you can use different figures in matplotlib, but i dont ...
1
vote
1answer
18 views

Changing the parameters of a function using sliders on python matplotlib

I'm working on a Hodgking-Huxley model of a neuron and I like to create a slider to see the results produced by changing some fixed parameters like maximal conductances. The plot is V vs t, which both ...
1
vote
1answer
33 views

how to take word repetition out of a list?

I have a project where I have to take input values from an Excel spreadsheet and plot them with matplotlib but the values that xlrd returns can't be put straight into Matplotlib because the values ...
0
votes
1answer
13 views

How is the number of levels in a 3D-contour-plot set?

Having an array witch looks like this plotting it as surface: plotting the same array as 3D-contour it only shows 5 levels. Where is set how many levels it shows, and how can I change it?
0
votes
0answers
23 views

Matplotlib FuncAnimation doesn't work properly

I have a trouble animating Networkx graph with Matplotlib in GTK form. It looks like update function in FuncAnimation is called only once. Here is drawing graph: def drawGraph(self, filename): ...
0
votes
1answer
14 views

bar plot cumulative data

I want to plot bars, with cumulative data rects1 = ax.bar(0.02+ind,a, width2,color='k') rects1a = ax.bar(0.02+ind, a2, width2, color='r',bottom=a) rects1b = ax.bar(0.02+ind, a3, width2, ...
0
votes
3answers
68 views

How to plot several chunks of data contained in a single file?

I have a file that contains 2 columns divided into blocks. Each block has a header followed by some data. The blocks are separated from each other by an empty line. Something like: x y1 ...
2
votes
0answers
40 views

What is the difference between auto-correlation in matplotlib and auto-correlation in pandas.tools.plotting?

How is the computation of auto correlation in matplotlib different from other libraries like pandas.tools.plotting, sm.graphics.tsa.plot_acf etc.? From the code below we can notice that auto ...
0
votes
0answers
13 views

Can I plot a series of data sets and on the same axis and animate it in Matplotlib/Python

I have a series of datasets that are all roughly the same (could be plotted on the same fixed axis) and I would like to make an animation out of them (an animation of them being plotted one after ...
1
vote
1answer
45 views

matplotlib - Drawing directly on the canvas

Due to performance issues for dynamical updates, I need to draw directly a lot of rectangle on the canvas as very low level, that is to say without using matplotlib.patches and as we have to do with ...
-1
votes
0answers
15 views

How to modify a matplotlib bar graph with text

Is it possible to show a value over each bar on a embedded graph using mplwidget?? I cannot come up with the correct method. At the same time...is it possible to modify the ycticks? I have done that ...
0
votes
1answer
19 views

How to plot an array correctly as surface with matplotlib?

I'been trying to plot a 3D-image with an array as input. For testing I made an little np.array ar = np.array([[1,2,3],[4,5,6],[7,8,9]]) My idea was to use the x-positions as x-value, the ...
0
votes
1answer
18 views

Need a confirmation of a library bug

I am quite new with Python and even I have done pretty deep and long research I think I need a confirmation from community before opening a case on github. I am plotting two "hinton plots" but I am ...
1
vote
2answers
24 views

Extending regressions beyond data in Matplotlib

I'm using Matplotlib and Numpy to plot linear regressions on time series plots in order to predict the trends in the future. Generating the regressions doesn't seem to be particularly difficult, but ...
0
votes
2answers
22 views

How to make a row of square graphs in matplotlib

I'm trying to make a row with 5 square graphs. I'm currently doing this: import matplotlib.pyplot as plt fig, axarr = plt.subplots(1, 5) #code to populate the graphs here plt.show() However, this ...
0
votes
1answer
13 views

pandas matplotlib resizing and removing labels

I am using pandas matplotlib to plot data from dataFrame. I'm doing it like that: df = pd.DataFrame({'type': dataFrame['Country'], labelName: 'Infant mort. rate'}) ax = df.plot(kind='bar',x= ...
1
vote
1answer
19 views

Python Pylab scatter plot error bars (the error on each point is unique)

I am attempting a scatter plot of 2 arrays for which I have a third array containing the absolute error (error in y direction) on each point. I want the error bars to between (point a - error on a) ...
0
votes
2answers
24 views

How to turn a simple csv into a line graph using matplotlib?

I created a simple csv file with numbers that approach pi and I would like to create and store the output as a png. I have a very simple csv, each tow contains the number I want to graph and import ...
1
vote
1answer
12 views

Overlapping polar countourf and scatter plot

Thanks to this very helpful post, I finally figured out how to make a polar filled-contour plot. However, when I moved to the next step and tried to add a scatter point to the same plot, I ran in some ...
1
vote
0answers
8 views

Adjust separation between axes and data on graph, Matplotlib, Python [duplicate]

I'm plotting line graphs in matplotlib and have an axis on each side of the graph (forming a box). The automatic axis scaling in matplotlib makes these axes sit at all the extremes of the data that ...
0
votes
2answers
34 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
22 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 ...
1
vote
0answers
56 views

How to pick a point in a subplot and highlight it in adjacent subplots in matplotlib

I want to create a scatter plot matrix which will be composed by some subplots. I have extracted from a .txt file my data and created an array of shape (x,y,z,p1,p2,p3). The first three columns of ...
2
votes
1answer
24 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, ...
4
votes
2answers
74 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
8 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
15 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 ...

15 30 50 per page