Question

#python, printing alpha beta and theta symbols # i want to be able to put an...

#python, printing alpha beta and theta symbols

# i want to be able to put an alpha beta and theta symbol in this graph using python
import numpy as np
import matplotlib.pyplot as plt

a = np.linspace(0,50,50)
b=[]
for i in a:
b.append(np.sin(i))

plt.plot(a,b)
####################################
####    problem is just below    #####
####################################
plt.xlabel('$\Theta$ (lol)')
plt.ylabel('$\Alpha$ (lol)')
plt.title('$\Beta$ (lol)')


plt.show()

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Please let me know if you require any further assistance.

You have the right idea and we can put almost any mathematical symbols in python using this method->

                      r'$\theta$'                        # Use the 'r' tag and put any mathematical expression inside the '$' tags. use '\' backward slash before the name of any symbol.

So your final solution will be like this :

   

import matplotlib.pylab as plt
import numpy as np

a = np.linspace(0, 50, 50)
b=[]
for i in x:
    b.append(np.sin(i))
plt.plot(a,b)
plt.xlabel(r'$\theta$')
plt.ylabel(r'$\alpha$')
plt.title(r'$\beta$')
plt.show()

You will get your solution as shown in the picture below:

Add a comment
Know the answer?
Add Answer to:
#python, printing alpha beta and theta symbols # i want to be able to put an...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • # python graph # i want to add a caption below this graph import matplotlib.pyplot as plt import ...

    # python graph # i want to add a caption below this graph import matplotlib.pyplot as plt import numpy as np import math #pylab inline from mpl_toolkits.mplot3d import Axes3D a = np.linspace(50,200,50) b = np.linspace(500,2000,50) c = np.linspace(5,20,50) plt.axes(projection='3d') for i in c: plt.plot(a,b,i) plt.title("title) plt.yaxis("y axis ") txt = "this is a graph of a bunch of lines" #cant get this to work plt.text(0.5, 0.05,0.7,0.1, txt, ha='center') ##cant get this to work plt.set_size_inches(7, 8,6, forward=True) #cant get this to...

  • Python, I need help with glob. I have a lot of data text files and want...

    Python, I need help with glob. I have a lot of data text files and want to order them. However glob makes it in the wrong order. Have: data00120.txt data00022.txt data00045.txt etc Want: data00000.txt data00001.txt data00002.txt etc Code piece: def last_9chars(x):     return(x[-9:]) files = sorted(glob.glob('data*.txt'),key = last_9chars) whole code: import numpy as np import matplotlib.pyplot as plt import glob import sys import re from prettytable import PrettyTable def last_9chars(x):     return(x[-9:]) files = sorted(glob.glob('data*.txt'),key = last_9chars) x = PrettyTable() x.field_names =...

  • python / visual studio Problem 1: Random Walk A random walk is a stochastic process. A...

    python / visual studio Problem 1: Random Walk A random walk is a stochastic process. A stochastic process is a series of values that are not determined functionally, but probabilistically. The random walk is supposed to describe an inebriated person who, starting from the bar, intends to walk home, but because of intoxication instead randomly takes single steps either forward or backward, left or right. The person has no memory of any steps taken, so theoretically, the person shouldn't move...

  • Problem 1: Random Walk A random walk is a stochastic process. A stochastic process is a series of...

    python / visual studio Problem 1: Random Walk A random walk is a stochastic process. A stochastic process is a series of values that are not determined functionally, but probabilistically. The random walk is supposed to describe an inebriated person who, starting from the bar, intends to walk home, but because of intoxication instead randomly takes single steps either forward or backward, left or right. The person has no memory of any steps taken, so theoretically, the person shouldn't move...

  • Python 1 import matplotlib.pyplot as plt 2 import numpy as np 3 4 abscissa = np.arange(20) 5 plt....

    python 1 import matplotlib.pyplot as plt 2 import numpy as np 3 4 abscissa = np.arange(20) 5 plt.gca().set_prop_cycle( ’ color ’ , [ ’ red ’ , ’ green ’ , ’ blue ’ , ’ black ’ ]) 6 7 class MyLine: 8 9 def __init__(self, * args, ** options): 10 #TO DO: IMPLEMENT FUNCTION 11 pass 12 13 def draw(self): 14 plt.plot(abscissa,self.line(abscissa)) 15 16 def get_line(self): 17 return "y = {0:.2f}x + {1:.2f}".format(self.slope, self.intercept) 18 19 def __str__(self):...

  • Python, given a code in class i just need help with the third bullet point ; using a and n (defin...

    Python, given a code in class i just need help with the third bullet point ; using a and n (defined in the second picture of python code) find the first digit for k! for k =1,...,n. you dont have to type in all this code just help me write the code in the first picture where it says: def benford(a): b = [0 for d in range(1,10)] #Do everthything in here return b 2.2 Generating data In this assignment...

  • i just want to verify i solved this correctly. for the energy diagram i had HOMO as E2 and LUMO as E3. For the pi bond energy i ended up getting Eπ = 3 alpha + 2 beta + square root 2 beta 1. Usin...

    i just want to verify i solved this correctly. for the energy diagram i had HOMO as E2 and LUMO as E3. For the pi bond energy i ended up getting Eπ = 3 alpha + 2 beta + square root 2 beta 1. Using Hückel Molecular Orbital theory for cyclooctatetraene2 (CaHe2: a. Show an energy level diagram for C3Hs2 with all of the possible energy levels in the pi bond system, and indicate the positions of the HOMO and...

  • this is my code to predict a housing price based on data but i get a...

    this is my code to predict a housing price based on data but i get a lot errors, how do i resolve all these errors 9]: import seaborn as sns from sklearn.linear model import LinearRegression 20]: import numpy as np import matplotlib.pyplot as plt %matplotlib inline import pandas as pd data- pd.read_csv('C:\\Users \\Downloads \\house-prices -advanced-regression-techniques\\test.csv) I data 20]: ScreenPorch PoolArea PoolQC Fence Id MSSubClass MSZoning LotFrontage LotArea Street Alley LotShape LandContour Utilities NaN MnPry 120 Lvl AlPub Pave NaN Reg...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT