Help:Creating charts with AI
This page explains how to create charts easily using AI. If you know more about it, please add the information to this page.

- To create a chart from AI, first gather the data needed.
For example, the glamorous Commons tool can output a table as well as XML. In this example this query is used. - Copy the relevant data. In this case in the XML simply
<usage project="de.wikipedia" usage_count="811"/><usage project="en.wikipedia" usage_count="517"/>
[…] - In an AI like GPT 5 mini, enter this with a prompt like
make a bar chart of the following data with 7 vertical columns (combining the lowest wikipedias as "Other") and no text labels. Create the matplotlib code for this.and below that prompt after a new line enter the data copied earlier. - Once you get the code from the AI, copy it.
- Save it into a new file like "newchart.py"
- Install python and matplotlib if you haven't done so already. Here a
python virtual environmentis used which you also need to set up first and then enter/path/virtual-environment/bin/pip3 install matplotlibwhere the path needs to be that of the virtual environment that you set up and pip3 in it. - Run
/path/virtual-environment/bin/python3 /path2/newchart.pywhere you need to enter the path to python3 and the path to the chart file you saved earlier - Check the resulting file. If there are any changes needed such as in regards to the labels, ask the AI to change those things and rerun the new matplotlib python code.
- After you got the file to look like intended, check whether things are accurate. Note that if you let the AI generate an image directly like a PNG or SVG file that you can download, it's quite likely it will be inaccurate such as having skewed scales so instead always use code. The example chart is on the right.
- Make sure to add the code used into the source field of your uploaded Commons file (as in the example). For this insert {{Igen|Matplotlib|+|s=|code=code here}} below the file information template