File:Lemniscate-of-Gerono2.svg

From testwiki
Jump to navigation Jump to search
    Original file (SVG file, nominally 678 × 438 pixels, file size: 21 KB)

    This file is from Wikimedia Commons and may be used by other projects. The description on its file description page there is shown below.

    Summary

    Description
    English: Lemniscate of Gerono: solution to y2=x2−x4. Parametric equation: [xy]=[cos⁡tsin⁡(2t)/2],t∈[0,2π].
    Date
    Source Own work
    Author Rumil
     W3C-validity not checked.

    Source code

    import matplotlib as mp
    import matplotlib.pyplot as plot
    import numpy as np
    from math import pi
    
    style = {
      "axes.linewidth": 3,
      "grid.linewidth": 3,
      "grid.linestyle": "solid",
      "grid.color": "#dadad0",
      "lines.linewidth": 3,
      "lines.markersize": 10,
      "xtick.labelsize": 24,
      "ytick.labelsize": 24,
    }
    
    for key in style:
      mp.rcParams[key]=style[key]
    
    fig = plot.figure()
    ax = fig.add_subplot(1, 1, 1)
    ax.set_aspect('equal')
    color1 = "#505050"
    ax.spines['bottom'].set_color(color1)
    ax.spines['top'].set_color(color1) 
    ax.spines['right'].set_color(color1)
    ax.spines['left'].set_color(color1)
    
    ax.axhline(y=0, color=color1,zorder=4)
    ax.axvline(x=0, color=color1,zorder=4)
    
    ax.xaxis.grid()
    ax.yaxis.grid()
    ax.set_axisbelow(True)
    ax.xaxis.set_tick_params(width=3,length=6,color=color1)
    ax.yaxis.set_tick_params(width=3,length=6,color=color1)
    
    t = np.arange(0,2*pi,0.02)
    plot.axis([-1.5,1.5,-1,1])
    plot.plot(np.cos(t),np.sin(2*t)/2,color='#0040b0',alpha=0.6,zorder=6,linewidth=6)
    
    ax.text(1.3,-0.94,"x", fontsize=32, style="italic", color="#202020")
    ax.text(-1.44,0.8,"y", fontsize=32, style="italic", color="#202020")
    
    # plot.show()
    plot.savefig("Gerono.svg",bbox_inches='tight')
    

    Licensing

    I, the copyright holder of this work, hereby publish it under the following license:
    Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
    The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

    Captions

    Add a one-line explanation of what this file represents

    Items portrayed in this file

    depicts

    25 March 2017

    21,554 byte

    438 pixel

    678 pixel

    image/svg+xml

    fed8da3538be8bc88308bd45681e062cdb4d35b8

    File history

    Click on a date/time to view the file as it appeared at that time.

    Date/TimeThumbnailDimensionsUserComment
    current14:47, 25 March 2017Thumbnail for version as of 14:47, 25 March 2017678 × 438 (21 KB)wikimediacommons>RumilSlightly lower thickness.

    There are no pages that use this file.