Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

significant figures on axes plot matplotlib

import matplotlib.pyplot as plt
import numpy as np
from matplotlib.ticker import FormatStrFormatter

fig, ax = plt.subplots()

ax.yaxis.set_major_formatter(FormatStrFormatter('%g'))
ax.yaxis.set_ticks(np.arange(-2, 2, 0.25))

x = np.arange(-1, 1, 0.1)
plt.plot(x, x**2)
plt.show()
Comment

PREVIOUS NEXT
Code Example
Python :: print(shahzaib) 
Python :: code error correction 
Python :: loading .dat file in python 
Python :: Write a Python program to accept two strings as input and check if they are identical copy of each other or if the second string is a substring of the first string. 
Python :: python api with live ercot real time prices 
Python :: Checking Availability of user inputted File name 
Python :: pysolr - connect to solr via vpn 
Python :: ist comperension python 
Python :: print [url_string for extension in extensionsToCheck if(extension in url_string)] 
Python :: sys executable juypter is incorrect visual code 
Python :: Create a python for loop that sums the numbers from 100 to 200 
Python :: pip upgrade command 
Shell :: how to check laptop serial number in ubuntu 
Shell :: ubuntu XAMPP Starting Apache...fail 
Shell :: docker delete all images 
Shell :: grep ip address 
Shell :: Remove composer for ubuntu 
Shell :: how to install yum in ubuntu 
Shell :: check chrome version ubuntu via terminal 
Shell :: kill all docker processes force 
Shell :: pip install urllib 
Shell :: ubuntu play on linux install 
Shell :: windows kill port 
Shell :: ubuntu list file by size 
Shell :: how to know fedora version 
Shell :: linux check graphics driver 
Shell :: flush dns cache linux 
Shell :: change master to main 
Shell :: pod file reinstall 
Shell :: zsh: no such file or directory: /usr/local/bin/composer.phar 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =