Skip to main content

All Questions

0 votes
2 answers
16k views

Installing Matplotlib in Windows 10 64bits

Could anyone tell me what files I should download and which statements I must execute in the command line to install Matplotlib? I have Python 2.7.13 on Windows 10 64 bit. These are the files I ...
12 votes
2 answers
3k views

2D plots are not sitting flush against 3D-axis walls in python mplot3D

I'm attempting to plot 2D data onto a 3D axis. I have the 3D shape working using ax.plot_surface but I'm unable to get the 2D data to sit flush against the axis walls using ax.plot. Here is a ...
64 votes
2 answers
46k views

How to change the current axis instance (i.e., gca()) in matplotlib

I use a trick to draw a colorbar whose height matches the master axes. The code is like import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable import numpy as np ax = ...
44 votes
2 answers
170k views

How to specify values on y axis of a matplotlib plot

I need to generate a graph using matplotlib like the one in the attached picture. So far I tried it like this: import matplotlib.pyplot as plt import numpy as np x = np.array([0,1,2,3]) y = np.array([...
4 votes
1 answer
9k views

Python, matplotlib pyplot show() not blocking

I'm having trouble with the show() function not blocking. I've taken over a python application from someone that left and I seem to remembering this worked on his (IT reclaimed) PC. Here's the code ......
13 votes
6 answers
96k views

Graphing a Parabola using Matplotlib in Python

I am trying to graph a simple parabola in matplotlib and I am confused as to how I am supposed to plot points on the parabola. So far, this is what I have: import matplotlib.pyplot as plt a=[] b=[] y=...
0 votes
1 answer
10k views

How to graph Learning Curve of Logistic Regression?

I am running a Logistic Regression and would like to plot the Learning Curve of this to get a feel for the data. Here is my code thus far: from sklearn import metrics,preprocessing,cross_validation ...
0 votes
2 answers
7k views

Using Python to Telnet into CISCO router and store the output on a machine locally

Im new to python, I managed to telnet into my cisco router using my python codes. I am able to show commands on the screen, but I would like to save the outputs locally on my linux machine, same ...
9 votes
2 answers
10k views

Zoom and Pan Options in plots for matplotlib on jupyter Notebook

I would like to have zooming and panning options for plots generated in matplotlib on jupyter notebook. I tried installing mpld3 but importing the package doesn't generate my plots at all. Is it an ...
32 votes
19 answers
194k views

ImportError: 'No module named plotly.plotly' in LinuxMint17.3

Whenever I am trying to compile the following code to get a line graph shows some errors. But I don't know how to fix it. Here is my code : import plotly.plotly as py import plotly.graph_objs as go #...
14 votes
2 answers
57k views

Increasing pie chart size with matplotlib, radius parameter appears to do nothing

Trying to make the pie larger. Looking at the docs, and other places, it says to set the radius. It seems no matter which value I put in the radius there's no increase. I'm posting the full code and ...
2 votes
1 answer
6k views

Matplotlib table falls outside plot area

I have a table within a plot using Matplotlib and the table spills out past the plot area. Is there a way to make this not happen, perhaps with an offset or something similar? import matplotlib.pylab ...
40 votes
2 answers
36k views

Matplotlib Error: "figure includes Axes that are not compatible with tight_layout"

After adding bbox_inches="tight" to an invocation of plt.savefig that has worked for several years, I get /usr/local/lib/python2.7/site-packages/matplotlib/figure.py:1744: UserWarning: ...
4 votes
2 answers
3k views

Matplotlib auto chemical formula subscript use without italicizing text

I am trying to automatically label the x-axis of a Matplotlib plot in Python2.7 with a chemical formula that has numbers as subscripts, without italics. Here is a code to show this: import numpy as ...
21 votes
3 answers
14k views

How to plot a rectangle on a datetime axis using matplotlib?

I tried to plot a rectangle on a graph with a datetime x-axis using the following code: from datetime import datetime, timedelta from matplotlib.patches import Rectangle import matplotlib.pyplot as ...

15 30 50 per page
1
2 3 4 5
71