# ChatGPT Volunteering Diagram Descriptions, Unprompted, in a Response to a Maths Related Question

I have no idea if the proof is correct, but I thought the inclusion of the diagram script was interesting (I originally asked the question with the intenstion of seeing whether the proof was provided as a LaTeX script, with the idea that I would then also ask for a diagram to help make sense of the proof…)

Can you provide me with a proof, and explanation of each step, pf pythagoras’ theorem?

Me to ChatGPT

The code is Asymptote/LaTeX code. The ChatGPT UI does not render diagrams (though in many cases it probably could, e.g. using Javascript packages or an embedded WASM powered renderer), but we can find previewers online (eg http://asymptote.ualberta.ca/ ) to view the result:

[See later in the document how I tried to get ChatGPT to improve on the generated Asymptote diagrams.]

Now back to the proof:

Again, we can preview the diagram:

The proof then concludes:

What are the [asy] bits in your explanation?

Me to ChatGPT

That is very useful, but I tend to use Python and matplotlib for diagrams.

Me to ChatGPT

Again, the ChatGPT UI doesnlt embed Pyodide WASM and an embedded output display (though it could), bu we can preview the code elsewhere (eg using JupyterLite):

That Python chart includes a frame and axes around the triangle and the edges are not directly labeled. Ideally, I would just see a triangle with labeled sides.

Me to ChatGPT

Executing the code elsewhere again:

The labels are not very clear. The b and c labels should be midway along the corresponding side

Me to ChatGPT

And this gives:

You are wrong. The a and c labels are applied to the same side when I render that example. The xytext values for those labels are the same, which means the labels are printed at the same location, rather than being applied to separate sides.

Me to ChatGPT

Which gives:

That is still wrong. the c label is now near a vertex, not the midpoint of the hypotenuse, if indeed it does apply to the hypotenuse?

Me to ChatGPT

The c label is still too high. It should be closer to the edge (lower down the plot). What parameter do I need to change to manually fix your code myself?

Me to ChatGPT

I then returned to the Asymptote code…

Thank you. With your asymptote code, I notice the labels are very large compared to the triangle and the diagram is a mess. I’m not even sure if the labels are in the correct location. How could that be fixed?

Me to ChatGPT

This re-renders the second diagram as follows:

In you revised asymptote code, the h and a labels obscure each other. Also, your points A and D are at the same location. Also, not all vertices are labeled?

Me to ChatGPT

The location of h is now easier read but is meaningless? If h refers to a height, should it perhaps label a new vertical line that is distinguished in some way (eg a dashed line or a two ended arrow) that denotes a distance measurement?

Me to ChatGTP

Which gives:

The dashed line is occluded by a solid line drawn connecting A and C (which is the same as D and C, because A and D are the same point). it would be useful to be able to see a dashed line representing the height distinctly, perhaps by drawing it slightly to the side?

Me to ChatGPT

Which messes things up a little:

I left it there…

Form this interaction, as with many previous ones (including other chats to co-create diagrams), the human user needs to act as a critic, editor and co-creator. In many cases, the (commented, especially if prompted to add comments, or explained, if you ask for an explanation) diagram descriptions that ChatGPT drafts are often good enough to get you started, and require only slight fixes. It can sometimes be a real challenge to find a prompt to get ChatGPT to fix the issue, and easier to just do it yourself. Which suggests that if you want to document a process, an interactive notebook style UI may be more attractive, becuase along with capturing your own notes and prompts and the ChatGPT reponses and rendered previews, you will also be able to include your own revised code (and add that to the prompt history). I’ve yet to try the `jflam/chat-gpt-jupyter-extension` or `TiesdeKok/chat-gpt-jupyter-extension` extensions (and there may be others…; eg Fernando Perez’s quick magic hack, `fperez/jupytee`) that bring conversational ChatGPT style ish-magic to Jupyter notebooks, but it’ll be really interesting to see how it feels and what sort of transcripts result from using them.

See also: there are various hacky VSCode extensions for ChatGPT in the VSCode marketplace. A currently popular one seems to be https://marketplace.visualstudio.com/items?itemName=JayBarnes.chatgpt-vscode-plugin .

## Author: Tony Hirst

I'm a Senior Lecturer at The Open University, with an interest in #opendata policy and practice, as well as general web tinkering...