Image:Square wave closeup.png

From Wikipedia, the free encyclopedia

Wikimedia Commons logo This is a file from the Wikimedia Commons. The description on its description page there is shown below.
Commons is a freely licensed media file repository. You can help.

A square wave, showing discontinuities.

[edit] Instructions

See Wikipedia graph-making tips.

Generated in gnuplot with the following script:

 #Set pretty PostScript output and filename
 set terminal postscript enhanced color lw 2 "Times-Roman" 20
 set output "square.ps"     

 #Set y axis limits so it doesn't go right to the edges of the graph
 set yrange [-1.5:1.5]
 set xrange [-0.5:2.5]

 #No legend for the functions
 set nokey

 #Add lightly-colored axes
 set yzeroaxis
 set xzeroaxis

 #Plot as lines and also points
 #with points:
 #1 = color red (linestyle 1?)
 #6 = point style 6 (render as circles in PostScript)
 plot "square.dat" with lines, "" with points 1 6

and data file:

square.dat

 # X    Y1
   -1   -1
   0    -1
   0    0
   0    1
   1    1
   1    0
   1    -1
   2    -1
   2    0
   2    1
   3    1

I tried to use set clip points to make the points not plot at the edges of the graph, but it wasn't working, so I just set the xrange and made the first and last points outside of the graph instead of right on the edges.

Then I converted the square.ps file to PDF, opened it in Adobe Illustrator, changed the fill style for the circles, changed the line style for the vertical lines, and saved.

To convert the PostScript file to PNG:

  1. Open it in the GIMP (make sure you have ghostscript installed! - Windows instructions)
    • Enter 500 under Resolution (it doesn't say "DPI" but I think that's what it means)
    • Uncheck Try bounding box (since the bounding box cuts off the edge, unfortunately. You can try with the bounding box first.)
    • Enter large values for Width and Height
    • Check Color
    • Check Strong anti-aliasing for both graphics and text
  2. Crop off extra whitespace (Shift+C if you can't find it in the toolbox)
  3. Possibly need to rotate it: Click ImageTransformRotate 90 degrees clockwise
  4. FiltersBlurGaussian blur at 2.0 px (No need to blur if you use strong anti-aliasing during conversion. I see no significant difference between end results.)
  5. ImageScale Image...
    • Width and Height at 25%
    • Cubic interpolation
  6. You can view at normal size if you want by pressing 1, Ctrl+E
  7. Save as Square wave closeup.png

Created by User:Omegatron using gnuplot, possibly with post-processing in the GIMP (PNG) or Inkscape (SVG)


I, the copyright holder of this work, hereby publish it under the following licenses:
Some rights reserved
Creative Commons Attribution iconCreative Commons Share Alike icon
This file is licensed under the Creative Commons Attribution ShareAlike license versions 3.0, 2.5, 2.0, and 1.0

Български | Català | Česky | Dansk | Deutsch | Ελληνικά | English | Español | Euskara | Estremeñu | Français | עברית | Italiano | 日本語 | 한국어 | Lietuvių | Nederlands | ‪Norsk (bokmål)‬  | Occitan | Polski | Piemontèis | Português | Русский | 中文 | +/-

GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation license, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation license".

Aragonés | العربية | Asturianu | Български | বাংলা | ইমার ঠার/বিষ্ণুপ্রিয়া মণিপুরী | Brezhoneg | Bosanski | Català | Cebuano | Česky | Dansk | Deutsch | Ελληνικά | English | Esperanto | Español | Eesti | Euskara | فارسی | Suomi | Français | Gaeilge | Galego | עברית | Hrvatski | Magyar | Bahasa Indonesia | Ido | Íslenska | Italiano | 日本語 | ქართული | ភាសាខ្មែរ | 한국어 | Kurdî / كوردی | Latina | Lëtzebuergesch | Lietuvių | Bahasa Melayu | Nnapulitano | Nederlands | ‪Norsk (nynorsk)‬ | ‪Norsk (bokmål)‬ | Occitan | Polski | Português | Română | Русский | Slovenčina | Slovenščina | Shqip | Српски / Srpski | Svenska | తెలుగు | ไทย | Türkçe | Українська | اردو | Tiếng Việt | Volapük | Yorùbá | ‪中文(中国大陆)‬ | ‪中文(台灣)‬ | +/-

You may select the license of your choice.

(In short, this means that you can copy and modify the image freely as long as you provide attribution; preferably in the form of a link back to this page.)

File history

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

Date/TimeDimensionsUserComment
current16:49, 22 July 20051,343×1,000 (40 KB)Omegatron
The following pages on the English Wikipedia link to this file (pages on other projects are not listed):