Search Results
|
Post |
Author |
Forum |
Replies |
Views |
Posted
[asc]
|
|
|
Thread: quiver plot scaling help
Post: RE: quiver plot scaling help
By simply adjusting the "scale=2" to "scale=4" or higher will make the vector arrows smaller but then you loose detail in terms of the field. So first I want to make the original contour plot bigger s... |
|
StillAnotherDave |
Homework |
1 |
1,751 |
Oct-26-2020, 09:17 AM |
|
|
Thread: quiver plot scaling help
Post: quiver plot scaling help
Hello all,
I have written some code to produce a contour plot (scalar field) and added a quiver plot (vector gradient) to display the gradient:
Contour:
plt.figure()
ax1 = plt.axes()
w = np.arange... |
|
StillAnotherDave |
Homework |
1 |
1,751 |
Oct-26-2020, 09:12 AM |
|
|
Thread: Latex spacing question
Post: Latex spacing question
Hi guys,
I imagine this is a pretty simple question:
plt.xlabel('$mass (kg)$')
plt.ylabel('$angular displacement (rad)$')why does the above code for axes labels not produce spaces between the words... |
|
StillAnotherDave |
General Coding Help |
0 |
1,493 |
Mar-28-2020, 05:51 PM |
|
|
Thread: Line of best fit for forward bias curve?
Post: RE: Line of best fit for forward bias curve?
(Feb-04-2020, 12:17 PM)jefsummers Wrote: Asking for a linear regression, not sure your data will exactly fit, but here goes.
import numpy as np
import matplotlib.pyplot as plt
from sklearn import da... |
|
StillAnotherDave |
Homework |
6 |
3,169 |
Feb-05-2020, 11:05 AM |
|
|
Thread: Line of best fit for forward bias curve?
Post: RE: Line of best fit for forward bias curve?
|
StillAnotherDave |
Homework |
6 |
3,169 |
Feb-03-2020, 09:09 AM |
|
|
Thread: Line of best fit for forward bias curve?
Post: RE: Line of best fit for forward bias curve?
(Feb-02-2020, 02:19 PM)Larz60+ Wrote: perhaps reading https://pyspice.fabrice-salvaire.fr/exam...curve.html will help
Hi Larz60+,
Thanks but I think the info on the link is to do with generating a ... |
|
StillAnotherDave |
Homework |
6 |
3,169 |
Feb-02-2020, 03:46 PM |
|
|
Thread: Line of best fit for forward bias curve?
Post: Line of best fit for forward bias curve?
Hello folks,
I have a physics report to write up and graphs need to be digitally produced. How do I add a line of best for the data below (the data points match the forward bias characteristic for a... |
|
StillAnotherDave |
Homework |
6 |
3,169 |
Feb-02-2020, 11:21 AM |
|
|
Thread: Plotting axes help
Post: RE: Plotting axes help
Thanks!! I'll have to do a bit more study to get the hang of it. New material for me.
Your help has been appreciated!! |
|
StillAnotherDave |
Homework |
11 |
3,624 |
Jan-24-2020, 04:29 PM |
|
|
Thread: Plotting axes help
Post: RE: Plotting axes help
Hi folks,
Will need to submit by 5pm this afternoon. So if anyone has any help on the above please do share. Many thanks.
Only this outstanding:
"Finally, compute the *trajectory* of our blue point... |
|
StillAnotherDave |
Homework |
11 |
3,624 |
Jan-24-2020, 03:28 PM |
|
|
Thread: Plotting axes help
Post: RE: Plotting axes help
Almost there!
I have modified my code so that values in degrees can be used (and are converted to radians for the formulae):
x1=np.linspace(-1, 1, 100)
x2=np.zeros(100)
y1=np.linspace(-1, 1, 100)
y2... |
|
StillAnotherDave |
Homework |
11 |
3,624 |
Jan-24-2020, 12:03 PM |
|
|
Thread: Plotting axes help
Post: RE: Plotting axes help
Yep ... this seems to do the job:
x1=np.linspace(-1, 1, 100)
x2=np.zeros(100)
y1=np.linspace(-1, 1, 100)
y2=np.zeros(100)
plt.plot(x1, x2, 'b')
plt.plot(y2, y1, 'b')
plt.plot(0.5, 0.4, 'bo:')
x1pri... |
|
StillAnotherDave |
Homework |
11 |
3,624 |
Jan-24-2020, 01:20 AM |
|
|
Thread: Plotting axes help
Post: RE: Plotting axes help
In the original code, the x and y axes are produced from four arrays:
x1=np.linspace(-1, 1, 100)
x2=np.zeros(100)
y1=np.linspace(-1, 1, 100)
y2=np.zeros(100)
plt.plot(x1, x2, 'b')
plt.plot(y2, y1, '... |
|
StillAnotherDave |
Homework |
11 |
3,624 |
Jan-23-2020, 05:19 PM |
|
|
Thread: Plotting axes help
Post: RE: Plotting axes help
(Jan-23-2020, 01:04 PM)jefsummers Wrote: Looks to me like you need to copy the arrays, then apply the formula to all the points in the arrays, and plot the new arrays (axes)
Hmm ... I think I unders... |
|
StillAnotherDave |
Homework |
11 |
3,624 |
Jan-23-2020, 02:39 PM |
|
|
Thread: Plotting axes help
Post: RE: Plotting axes help
(Jan-23-2020, 01:26 AM)jefsummers Wrote: You need an array of zeros as well, such as z=np.zeros(100)
Then, use plt.plot(x1,z) and plt.plot(z,y1) to plot your axes.
Then use plt.plot() to plot the bl... |
|
StillAnotherDave |
Homework |
11 |
3,624 |
Jan-23-2020, 10:48 AM |
|
|
Thread: Plotting axes help
Post: Plotting axes help
Hello,
The question states:
As we will later be acting on the coordinate axes with passive transformations, we will need to have our axes stored in arrays. We can represent the x-axis as two arrays:... |
|
StillAnotherDave |
Homework |
11 |
3,624 |
Jan-22-2020, 02:25 PM |
|
|
Thread: Order of operations for reassignment of a variable
Post: Order of operations for reassignment of a variable
Hello folks,
A quick question about the following lines:
x=x**3+2
x=3*x+1If I were to write this as an equivalent single calculation, does python interpret the first value of x into the second paren... |
|
StillAnotherDave |
Homework |
1 |
1,695 |
Jan-21-2020, 12:10 PM |
|
|
Thread: While loop - series expansion
Post: RE: While loop - series expansion
|
StillAnotherDave |
Homework |
3 |
4,850 |
Dec-18-2019, 10:15 AM |
|
|
Thread: While loop - series expansion
Post: While loop - series expansion
Hello folks,
I've put together the following code for a series expansion for the function ln(1+x):
import numpy as np
x = float(input('Please input a number x between 0 and 1 '))
logx = np.log(x+1... |
|
StillAnotherDave |
Homework |
3 |
4,850 |
Dec-17-2019, 06:37 PM |
|
|
Thread: Basic Boolean homework help
Post: RE: Basic Boolean homework help
Not exactly sure what I'm doing here:
results = np.array([[54, 1, 0], [56, 0, 1], [72, 0, 0], [34, 3, 0]])
names = np.array(['Amy', 'Bob', 'Carol', 'Dave'])
progresses = np.array([(avg >= 40) and... |
|
StillAnotherDave |
Homework |
9 |
3,576 |
Nov-27-2019, 12:38 PM |
|
|
Thread: Basic Boolean homework help
Post: RE: Basic Boolean homework help
(Nov-27-2019, 10:17 AM)perfringo Wrote: Input returns string. You are trying to perform power of two (and other math operations) on string.
Ah okay. I need to add an int conversion. Fab!!
Almost th... |
|
StillAnotherDave |
Homework |
9 |
3,576 |
Nov-27-2019, 10:47 AM |