0% found this document useful (0 votes)
6 views16 pages

Mathsematica

sksmathsematica

Uploaded by

Likith Gagan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views16 pages

Mathsematica

sksmathsematica

Uploaded by

Likith Gagan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

DISPLAY OF RAW DATA PROVIDED IN CARTSIAN

FORM

. Imports matplotlib.pyplot as plt for convenience.


. Defines sample lists x and y for the x and yaxis data (replace
. these with your actual data).
. Uses plt.plot(x, y) to create a line plot with the provided data.
. Sets labels for the x and y-axis using plt.xlabel and plt.ylabel.
. Adds a title to the plot (optional) using plt.title.
. Displays the plot using plt.show.
Functions executed with their syntax are :-
1.Function - plt.xlabel()
Syntax - plt.xlabel(xlabel, labelpad=None, **kwargs)
2. Function - plt.ylabel()
Syntax - plt.ylabel(ylabel, labelpad=None, **kwargs)
3. Function - plt.plot()
Syntax - plt.plot(*args, **kwargs)
4. Function - plt.tittle()
Syntax - plt.title(label, fontdict=None, loc='center', pad=None ,
. **kwargs)
5. Function - plt.show()
Syntax - plt.show()
Note:here values are provide using list for convinence

1.Execution of function plt.plot() and plt.show()

Output:
2.Execution of function plt.xlabel() and plt.ylabel()
The labelling of data representing should be kept known for the client
and it can be aligned to the corresponding data using above functions.

Output:
3.Execution of plt.title function:
Since title of any data representation plays a crucial role.
Output:

Now lets go through anothers 3 functions :


Customize the legend (): plt.legend() offers various options to customize the
legend's appearance and behavior. Here are some common customization
arguments:
1. Function - plt.legend()
Syntax - plt.grid(b=None, which='major', axis='both', **kwargs)
2. Function - plt.grid()
Syntax - plt.legend(handles, labels, **kwargs)
3. Function - plt.tight_layout()
Syntax - plt.tight_layout(pad=1.08, h_pad=None, w_pad=None,
. rect=None)
New function
1.Function - plt.style.available()
Syntax - available_styles = plt.style.available()
2. Function - plt.style.use()
Syntax - plt.style.use(style_name)
3. Function - plt.plot()
Syntax - plt.plot(x, y, fmt=None, *, data=None, **kwargs)

You might also like