Yes, you can compost artichokes.
The soft “hearts” compost down quickly whereas the fibrous bits of the leaves (what is usually leftover from eating a globe artichoke) take a bit longer. The tough leaves are actually a useful addition to a compost heap – while like most kitchen waste, they’re a “green” in composting terms, they keep their structure a lot longer than the likes of spinach or apples — this helps preserve the air flow in the heap and thus aids the composting process.
Avoid composting them though if they have come into contact with “don’t compost” things such as fats or meat during the cooking process.
If you’ve grown your own, you can compost the leaves and stems from the plants too. The latter tend to be quite tough so you might find it beneficial to break them up into smaller pieces – that way, they’ll break down quicker and won’t clog up your compost heap so much in the meantime.