Python pylab.xscale() Examples

The following are 3 code examples of pylab.xscale(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module pylab , or try the search function .
Example #1
Source File: test.py    From CalculiX-Examples with MIT License 5 votes vote down vote up
def solid_plot():
	# reference values, see
	sref=0.0924102
	wref=0.000170152
	# List of the element types to process (text files)
	eltyps=["C3D8",
		"C3D8R",
		"C3D8I",
		"C3D20",
		"C3D20R",
		"C3D4",
		"C3D10"]
	pylab.figure(figsize=(10, 5.0), dpi=100)
	pylab.subplot(1,2,1)
	pylab.title("Stress")
	# pylab.hold(True) # deprecated
	for elty in eltyps:
		data = numpy.genfromtxt(elty+".txt")
		pylab.plot(data[:,1],data[:,2]/sref,"o-")
	pylab.xscale("log")
	pylab.xlabel('Number of nodes')
	pylab.ylabel('Max $\sigma / \sigma_{\mathrm{ref}}$')
	pylab.grid(True)
	pylab.subplot(1,2,2)
	pylab.title("Displacement")
	# pylab.hold(True) # deprecated
	for elty in eltyps:
		data = numpy.genfromtxt(elty+".txt")
		pylab.plot(data[:,1],data[:,3]/wref,"o-")
	pylab.xscale("log")
	pylab.xlabel('Number of nodes')
	pylab.ylabel('Max $u / u_{\mathrm{ref}}$')
	pylab.ylim([0,1.2])
	pylab.grid(True)
	pylab.legend(eltyps,loc="lower right")
	pylab.tight_layout()
	pylab.savefig("solid.svg",format="svg")
	# pylab.show()


# Move new files and folders to 'Refs' 
Example #2
Source File: _pylab_tweaks.py    From spinmob with GNU General Public License v3.0 5 votes vote down vote up
def image_scale(xscale=1.0, yscale=1.0, axes="gca"):
    """
    Scales the image extent.
    """
    if axes == "gca": axes = _pylab.gca()

    e = axes.images[0].get_extent()
    x1 = e[0]*xscale
    x2 = e[1]*xscale
    y1 = e[2]*yscale
    y2 = e[3]*yscale

    image_set_extent([x1,x2],[y1,y2], axes) 
Example #3
Source File: _pylab_tweaks.py    From spinmob with GNU General Public License v3.0 5 votes vote down vote up
def xscale(scale='log'):
    _pylab.xscale(scale)
    _pylab.draw()