Matplotlib Definition and 16 Threads
-
Python Problem importing matplotlib in Python
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...- PeroK
- Thread
- Matplotlib Python
- Replies: 8
- Forum: Programming and Computer Science
-
J
Python How to Plot y=x^2 Using Matplotlib?
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()- joseph2015
- Thread
- Matplotlib Plotting
- Replies: 6
- Forum: Programming and Computer Science
-
Matplotlib with pgf backend, problem with underscore
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...- fluidistic
- Thread
- Matplotlib
- Replies: 7
- Forum: MATLAB, Maple, Mathematica, LaTeX
-
Python Changing the default font in matplotlib to "Times New Roman".
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...- amjad-sh
- Thread
- Font Matplotlib
- Replies: 6
- Forum: Programming and Computer Science
-
C/C++ From when does matplotlib require Visual C++? (Python 3.8.0)
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...- Wrichik Basu
- Thread
- Matplotlib Visual
- Replies: 2
- Forum: Programming and Computer Science
-
Why matplotlib is not working on the VSCode
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()...- Arman777
- Thread
- Matplotlib
- Replies: 4
- Forum: Programming and Computer Science
-
S
Python Fitting xtickslabels on a plot (matplotlib)
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, ...]...- schniefen
- Thread
- Fitting Matplotlib Plot
- Replies: 3
- Forum: Programming and Computer Science
-
Animation using matplotlib query
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...- Danny Boy
- Thread
- animation code matplotlib python
- Replies: 1
- Forum: Programming and Computer Science
-
Python Plotting a 2d trajectory with Matplotlib
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]...- Avatrin
- Thread
- 2d Matplotlib Plotting Trajectory
- Replies: 1
- Forum: Programming and Computer Science
-
Python How to plot vector fields in Matplotlib
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 =...- JD_PM
- Thread
- Fields Matplotlib Plot Python Vector Vector fields
- Replies: 1
- Forum: Programming and Computer Science
-
J
Python Contour plot of Earth's magnetic field in Python
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)(ρ) *...- jackthestudent
- Thread
- Contour plot Field Magnetic Magnetic field Matplotlib Plot Python
- Replies: 4
- Forum: Programming and Computer Science
-
Python Removing previously plotted points on scatter plot; python
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...- Morbidly_Green
- Thread
- Matplotlib Plot Plotting Points Python
- Replies: 2
- Forum: Programming and Computer Science
-
A
Python Help with Python modelling of a particle in a 2D box
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...- Alex Cros
- Thread
- 2d Box Classical physics Matplotlib Modelling Particle Programming Python
- Replies: 1
- Forum: Programming and Computer Science
-
Python [Python] Custom tick marks in matplotlib
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...- sk1105
- Thread
- Marks Matplotlib Python
- Replies: 4
- Forum: Programming and Computer Science
-
F
Python Python, matplotlib plot 2D histogram on polar axis.
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...- funcosed
- Thread
- 2d Axis Histogram Matplotlib Plot Polar Python
- Replies: 4
- Forum: Programming and Computer Science
-
A
Mathematica Mathematica vs gnuplot vs matplotlib (efficency)
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...- andresordonez
- Thread
- Gnuplot Mathematica Matplotlib
- Replies: 1
- Forum: MATLAB, Maple, Mathematica, LaTeX