Using ChatGPT+vision to copy the style of a pretty chart
ChatGPT can take a screenshot of a chart as an input and give you Python code to recreate a basic version of a chart with the same style
ChatGPT can now see and understand images, and I promised you interesting examples of what can be done with this capability. Here is one I found a little mindblowing.
Look at this visualization that I found in a tweet:
When I have numbers to report, I usually put them in a table. Or if I feel like I need to put in some effort, I’ll make a bar chart. I don’t do a bubble map like this. Because it is just too much work.
Or is it?
I just uploaded this image to ChatGPT and asked it:
What do you think happened?
Actually, the first version of the code it produced had messed up the size of the circles in the legend at the bottom left (the circles were the same size as the circles in the actual map—huge). So I had to scold it and ask it to fix that. After fixing it, the circles in the legend did not have any colours, so I had to scold it again. But the 3rd time it produced this. This brings up an important point that needs to be repeatedly mentioned: You cannot trust the output of ChatGPT. You have to double-check it and point out the problems to ChatGPT until it fixes them all.
Earlier, I had written about how you can use ChatGPT to extract data and put it in nice tables. Two new capabilities have now been added to it. First, you can extract data from images: not just PDFs and text. And second, you can ask ChatGPT to produce Python code to visualize them in a style that you happened to see somewhere.
Will it work for all kinds of visualizations? Of course not. It is still limited. But it will get better.
But don’t assume it can’t do something. Here’s a different example:
And this is what I got:
Pretty cool, isn’t it?
No, not really. At this point, those who’ve been paying attention would know that you must push ChatGPT. Be a demanding boss. ChatGPT is like a lazy employee, it takes short cuts and you need to make it do more. So here goes:
Did it work?
As usual, please forward this to other people and encourage them to subscribe. The ability to use ChatGPT well is going to be an important factor in the career success for all of us in the near future.