Wikipedia talk:How to create charts for Wikipedia articles
![]() | This project page does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||||
|
Gnuplot??
[edit]In the part about Gnuplot, it suggests to create postscript files and then to convert them to png. The output is very nice, but according to the guidelines of Wikipedia it should be better to use SVG for plots: this way we get the highest quality at the minimum space.
Should we change the article according to that?? (it is enough to put "set terminal svg" at the beginning of the gnuplot script!) Alessio Damato 12:07, 26 November 2005 (UTC)
- I've updated it, but it needs work. The article was written before SVG was supported.
- No, it's not as simple as setting the terminal to SVG, as the default output is quite inferior. Lots of tweaks need to be made. I am constantly trying to figure out the best settings. Image:sinc function (normalized).svg is the best I have come up with so far. — Omegatron 04:34, 4 June 2006 (UTC)
- I just tried using gnuplot for the first time, and it took me about 5 hours to make a pretty simple graph. (Image:Geothermal_capacity.svg) I think I'm more technically inclined than most Wikipedia editors, so that's pretty bad. I think any recommendation to use gnuplot here should be accompanied with warnings about the sparse documentation, the inability to make pie charts, the buggy margin and offset calculations that have to be adjusted by hand, the fact that these margins and offset will be different in the SVG output than the windows terminal, the impossibility of saving SVG settings since they reset to windows defaults every time you load an SVG plot file, the need to close the output file with "set ouput" before you can view it, the necessity to keep data and instruction files separate, etc. In short, it is not at all suitable for the average user. The list of recommended software should start with spreadsheets like Excel and OpenOffice Calc, maybe followed by the R programming language for more complicated graphs. (Although I haven't tried R yet.)--Yannick (talk) 17:01, 12 April 2009 (UTC)
- Making good images is always going to take a while. But documentation is usually the reason why any FOSS program is hard to use. The people writing code don't write documentation. There are a bunch of pages at Los Alamos (Not So Frequently Asked Questions), last updated Late 2005, which has some good hints: http://t16web.lanl.gov/Kawano/gnuplot/index-e.html A person who has a blog with some good hints which is more up to date is (3rd quarter 2010): http://gnuplot-tricks.blogspot.com/. As far as I know, Octave, R and a few other packages actually use Gnuplot to make plots. There was a suggestion in one of the pages in Wikimedia/Wikipedia that SVG produced smaller files than PNG. I am producing what might be called a simulation of a gamma spectrum using Gnuplot. The PNG is about 1/6 the size of the SVG from Gnuplot. Plotting what are nominally "delta functions" is probably always going to be like this. And the number of samples has to be significantly more than 1000 to get accurate peak heights. You can set the cursor at the peak to see what the plot has for a peak height. Instead of 'plot f(x)' to plot everything, you can 'print f(0.1234567)' to print the value of the function at the peak (here assumed to be 0.1234567). If the plot height isn't close enough to the true value (from the print), you don't have enough samples. Fortran (talk) 00:00, 10 November 2011 (UTC)
This page is useful. Maybe also worth mentioning that if the graph is a relatively simple bar graph, it can be created by EasyTimeline, which is fun, although the learning curve is a bit steep. (The easiest way to create a new one is to adapt an existing one.) pfctdayelise (translate?) 14:23, 15 November 2006 (UTC)
Alternative to Inkscape
[edit]Hi, Have you heard/read about geogebra? I think this might be a lot more useful than Inkscape or maybe even GnuPlot for making plots. I don't want to promote it, but I think it is much easier to use to make graphs than Inkscape or GnuPlot for a beginner. Here's its homepage if you want to take a look at it: http://www.geogebra.org/cms/ It's free software and runs on several platforms as it is programmed in Java —Preceding unsigned comment added by 85.127.185.228 (talk) 00:52, 21 March 2008 (UTC)
- The last time I tried it, the SVG output is wonky. I also remember the author explicitly stating that the program was not intended for artists, and hence he would not develop features for them. It is a great program though. Maybe he was just having a bad day. SharkD (talk) 05:14, 12 August 2009 (UTC)
- More specifically, GeoGebra is not intended as a design tool for creating documents suitable for publishing. It is an interactive program for students to learn the fundamentals of geometry. As of right now, centimeters are the only units supported for image export. Not inches. Not pixels. To determine the exact pixel size of the output you have to 1) set the dots-per-inch, 2) manually calculate the desired output size in inches based on the selected dpi, and 3) convert this value to centimeters. If you want to set the viewing area and coordinate axes to use precise pixel dimensions, you have to 1) decompress the GGB file, 2) modify the decompressed XML file by hand, and 3) recompress everything again. It's a serious pain in the a**. Unfortunately, GeoGebra is the only program out there with its capabilities.
- SVG output is also wonky. The program stores one set of values for element positions, another set of values to scale everything to match what is seen in the application, and a third set of values for the viewport. If your requirements aren't too stringent, then I suppose you could just get away with adjusting the size of the viewport (though you have to make sure not to change the aspect ratio).
- In this case and for this application, FOSS does not adhere to KISS. SharkD Talk 05:41, 15 November 2009 (UTC)
Graphs in Excel or Matlab
[edit]I was wondering if graphs made in commercial software like Microsoft Excel, Matlab or Mathematica are allowed under a free licence. I would expect that those companies put restrictions in their licences regarding the use of the graphs that can be produced with them. Yet I see a lot of Excel graphs, for instance in here and here. Does anyone know this? Mtcv (talk) 15:33, 21 July 2008 (UTC)
- In general, Yes, as long as the EULA doesn't prohibit it. 'Normal' licenses don't often restrict what you can do with the content you make with the program, but academic and some other limited licenses (like on Student editions of Microsoft Office 2007, though it doesn't obviously say so) do put some restrictions on what you can do with the content (usually, that it be used for educational and/or non-commercial purposes only), in exchange for a cheaper price (though, for MS Office 2007, that's obviously not true, since the restriction applies to the retail version of the edition). Note that Wikipedia does not allow non-commercial images to be used without also having a fair-use rationale.
- However, there are also several FOSS alternatives with no such restrictions.
Program Alternative Excel OpenOffice.org, Gnumeric, R Matlab Octave Mathematica Maxima
More How To on including data and instructions to update wanted
[edit]For economic data in particular, the graphs need to be updated periodically, eg GDP, DJIA historical plots. I see some graphs include a data table, but most don't, and I don't see details on instructions to produce update. Can more information be provided on this with recommendations? I think that the data plus the GNUplot commands are the two key requirements. Mulp (talk) 20:08, 11 August 2009 (UTC)
examples?
[edit]Would it make sense to have examples of GPL code that generates figures? I am thinking of some of the figures I have made might be useful. i.e. File:USDebt.png PDBailey (talk) 22:42, 17 August 2009 (UTC)
- You can use OpenOffice to create these sorts of charts. However, SVG is the preferred image format, and OOo's SVG output isn't always correct. SharkD (talk) 03:19, 4 November 2009 (UTC)
Gnuplot Inkscape compatability
[edit]I'm trying to create graphs in Gnuplot and then do post-processing for them in Inkscape. I export the SVG from Gnuplot as in the article and the result looks right when opened in Firefox, but when I open the file in Inkscape I don't see the graph. The graph is there; if go you into the XML editor in Inscape you can select it and then manually set the stroke color which will make it appear. Apparently, Gnuplot uses "stroke:currentColor;" to set the color of the curve and Inkscape only recognizes color names, so if you change the SVG to "stroke:black;" instead then Inkscape will be able to read the file properly and the cirve will appear when you open it. I've tried playing with the linetype and linecolor settings in Gnuplot but it doesn't seem to help. As I said, there is a workaround but it's a bit of a kludge. Is there something I'm doing wrong here or is it Gnuplot or Inkscape or both not working properly?--RDBury (talk) 05:15, 5 September 2009 (UTC)
- Thanks for the helpful tip. SharkD (talk) 02:53, 7 September 2009 (UTC)
pstoedit
[edit]pstoedit doesn't support svg, it requires shareware plugin.Yrogirg (talk) 07:11, 18 September 2009 (UTC)
- Please name and link to the plugin, so that everyone may know what you are talking about. SharkD Talk 05:51, 15 November 2009 (UTC)
Random links
[edit]- Here's a thread describing Gnumeric, a free spreadsheet software that is integrated with GNUplot (meaning you can create charts directly in GNUplot).
- Here's a thread I personally started discussing the woes of getting SVG output from OpenOffice into Inkscape.
- Here's a wiki page documenting users' experiences with SVG in OpenOffice.
- Here's a blog article regarding one user's efforts at importing/exporting between Inkscape and OpenOffice.
- Here's a third-party tool that can be used to import SVG images into OpenOffice. Unfortunately there's no corresponding export tool.
SharkD (talk) 04:31, 4 November 2009 (UTC)
SharkD Talk 10:32, 20 November 2009 (UTC)
Gnuplot from Octave
[edit]"gset" functions were deprecated in octave 2.9.11 (3.0 branch) and all their substitutions like __gnuplot_raw__() were excluded in 3.2.0. The section about GNU Octave is horribly outdated. —Preceding unsigned comment added by 159.93.74.153 (talk) 12:58, 25 August 2010 (UTC)
Invitation to discussion
[edit]Editors interested in this page may be interested in the discussion at WT:WikiProject Medicine#Chart_workshop. WhatamIdoing (talk) 22:42, 6 December 2010 (UTC)
3D surface plots
[edit]I stumbled across a (Windows) tool to create 3D surface plots in SVG a while ago. I think it was called "Agony" or something. Anyone know what I'm talking about? 76.252.49.90 (talk) 02:27, 7 March 2011 (UTC)
- I was thinking of this. Still not sure how it's supposed to be used, though. 76.252.49.90 (talk) 02:43, 7 March 2011 (UTC)
Incorrect Main template pointing to page on record charts
[edit]This article cuurently has the hatnote "main|Wikipedia:Charts". That is an article on record charts, so obviously wrong. I presume it is supposed to point somewhere else. --Boson (talk) 21:25, 5 May 2013 (UTC)
Choosing colors for charts
[edit]Here's a blog post that I found very helpful for picking colors for charts and data visualizations. Just posting here in case others find it useful: https://blog.graphiq.com/finding-the-right-color-palettes-for-data-visualizations-fcd4e707a283. Kaldari (talk) 21:34, 6 October 2017 (UTC)
More detailed instructions on uploading, please
[edit]I came to this page to learn how to create and include a simple graph on a WP article. What I've understood is that I should enter the data in SVG format. What I'm unclear of are the exact steps after that.
- Create SVG file. Got it.
- Upload the SVG file... to where? How?
- Edit this article to include my graph... how? What exactly do I enter in the article?
If the instructions could be updated to answer these questions, that would be very helpful. Thanks! --В²C ☎ 19:37, 2 May 2019 (UTC)
- I presume the answer to #2 is Wikipedia:File Upload Wizard. --В²C ☎ 17:33, 3 May 2019 (UTC)
Incomprehensible
[edit]This is completely ridiculous. Don't tell me to go to code crap in a terminal just to make a graph, or if you do, lay out very very clear, tiny step-by-tiny step, instructions on how to do it. Don't just say 'go to gnuplot and run this data plot'. This is completely incomprehensible and exhausting to me, who is familiar with computers and coding, imagine how someone unfamiliar with technology would find it. And Wikipedia says it wants to make it easier to edit and take part. Why can't I just use a LibreOffice graph? — Preceding unsigned comment added by 37.164.38.114 (talk) 15:20, 1 October 2019 (UTC)
interactive graphs on wikipedia?
[edit]Can interactive graphs, like a plotly graph, with popups be uploaded in wikimedia and used on a wikipedia page? Found this, about Kartographer. Is there anything on data graphs in addition to maps? thanks. 03:02, 1 February 2020 (UTC) — Preceding unsigned comment added by Jtamad (talk • contribs) 03:10, 1 February 2020 (UTC)
Graph extension
[edit]I was wondering how people here feel about the graph extension. While it produces fairly nice graphs and charts and must have required a fair amount of work to code, it completely ignores Guideline #1 from the list here, as it does not produce SVG outputs. There is an alternative, SVG Chart on Commons, but that does not seem to be maintained anymore. I was just wondering if this is an issue that has already been discussed somewhere, and if anything can be done to improve matters. KarlFrei (talk) 07:16, 7 February 2020 (UTC)
- I suppose my question boils down to: does the text "Use SVG whenever possible" represent Wikipedia consensus / official policy, or is this just somebody's opinion? The line was put in the article in 2006, but as I said, is completely ignored in some areas of Wikipedia. KarlFrei (talk) 07:40, 7 February 2020 (UTC)
Uploading source code?
[edit]Could we recommend uploading source code? So sad that there are so many great diagrams I can't modify or understand how they were created. The question is where should you put the source code? Some put it in the summary, some in the description, some in the talk page. We need one place where you can upload source code files.--Volker Weißmann (talk) 17:47, 22 December 2021 (UTC)
- The description seems to be the best place. What is the summary? I've never seen the talk page used. Wqwt (talk) 17:51, 16 October 2023 (UTC)
TikZ
[edit]Does anyone have experience with drawing figures with TikZ? It seems to be popular on TeX Stack Exchange. Wqwt (talk) 17:54, 16 October 2023 (UTC)