I'm running Python 3.8.3 on Windows 10 and was have installed matplotlib, but I can't get it to work. If I try import matplotlib then first it seems to spit out some output (always the same) from a couple of basic test programs I wrote (which is really weird), then just gets a bunch of errors...
import matplotlib.pyplot as plt
R = 2
for x in range(0,50):
y = x**R
# plt.plot(x,y,marker = 'o')
plt.plot(x,y,'--')
plt.xlabel('X-axis')
plt.ylabel('Y-axis')
plt.title('plot test')
plt.legend()
plt.show()
I use matplotlib to create files.pgf that I can \include{} in my latex documents. All works nicely, except when I want to make a reference to some equation of my latex document. For example, I when plot several curves on a graph and label them as "Coming from expression ..." where ... is...
I want to submit an article to an aps journal, so the labels of the figures have the "Times New Roman" font.
I had used the package matplotlib to get the figures and I want to make "Times New Roman" the default font. So, what code I need to write for this to be achieved?
Note that I used the...
I had Python 3.7.3 installed on my laptop. I decided to upgrade to 3.8.0, and after installing all necessary packages, uninstall the old version.
The installation of 3.8.0 was successfully done. With pip, I installed scipy, numpy and sympy. Now when I tried to install matplotlib, it threw an...
I wrote a basic plotting code and I run it on the VS code my somehow the program cannot run it
I deleted python itself and VS code and I downloaded them again, but the problem is not solved.
import matplotlib.pyplot as plt
x = [1,2,3]
y = [4,5,6]
plt.plot(x,y)
plt.show()...
How could I improve the below code to fit all the xtickslabels on my plot more nicely (i.e. more spacing between the labels, higher resolution)? Thanks!
from pyplot import *
yearmonthday=['2003-01-01', '2003-02-01', '2003-03-01', ...] #len(yearmonthday) is 155
kwh = [88883, 99221, 100002, ...]...
I am trying to animate a plot of two distinct points (blue and green points) moving about the complex unit circle using Python's Matplotlib library. The problem I am having is that the animation does not remove and update the previous data points but rather sequentially smears it on the unit...
Hi
I have a 2d trajectory of a center of mass which I have saved in an array such that r=[[x(t_1),y(t_1)],[x(t_2),y(t_2)],...,[x(t_n),y(t_n)]] where x is x coordinate of the position and y is the y-coordinate of the position.
I have tried this:
xx = [t[0] for t in r]
xy = [t[1] for t in r]...
Hi, I want to plot the vector field ##\vec F = ye^x \hat i + (x^2 + e^x) \hat j + z^2e^z \hat k##
The code I have tried:
# The components of the vector field
F_x = y*e**x
F_y = x**2 + e**x
F_z = z**2*e**z# The grid
xf = np.linspace(-0.15, 2.25, 8)
yf = np.linspace(-0.15, 2.25, 8)
zf =...
The Earth's magnetic field is cylindrically symmetric and can be described using cylindrical coordinates, (ρ,z,φ). The components of the magnetic field are given by:
(B_φ) = 0
(B_ρ) = −∂A/∂z,
(B_z) =(1/ρ) * ∂(ρA)/∂ρ.
The vector potential for a dipole field is given by
(A_φ) = (B_e)(ρ) *...
Homework Statement
I'm plotting moving particles and I need a way to refresh the graph space with every loop. Meaning I want the points to NOT leave a trail of other points behind them . Basically I want to get rid of the old points as I plot new ones.
Homework Equations
N\A
The Attempt at a...
Hello guys, I programmed a physics simulation where a particle with some initial conditions bounces off the walls of a 2d container. The simulation also includes gravity in the y-coordinates. The aim of the project is to produce a visual animation and further on include more particles and...
I've looked around for this and so far haven't found anything close enough to what I'm after.
In matplotlib, I want to get a specific tick on the x-axis to label a particular value. I know how to use axvline to get a vertical line marking that point, which is good, and I know how to add...
Any python/matplotlib experts out there?? This one has been driving me crazy all day. I have three vectors, azimuth, frequency and power, which I would like to histogram and plot on a polar axis. I can plot a scatter plot this way no problem but the histogram gets messed up somehow. An example...
Hi, I'm currently working on a C program where I have a huge 2d array that changes with time, so in the end, what I have is a 3d array (double 25*24000*100) in a plain text file (about 700MB). I tried to import with Mathematica7 as a "Table" but after a long time (about 15 minutes) the kernel...
Hi there,
I am plotting some data onto a hammer plot using ipy- matplotlib. The axes on the plot range from alpha= -pi:pi and beta=-pi/2:pi/2. I have a value (lets call it delta) for each point on the plot where (alpha=integer,beta=integer). I have arranged the delta values in ascending order...