This depends a lot on your arrangement with the university, as well as the context of the figure:
As DCTLib has already pointed out in their answer, first of all, the copyright legislation this is subject to has an influence on this, both with respect to you as well as any publishers of the paper. The legal side of this may also be related to whatever may be stated in any contracts you signed.
Now, concerning the question whether this is a "good way" to do things, I am used to arrangements where the unspoken agreement exists that any graphic produced by an employee of the university during their work is free for PR people and similar to use in presentations. Your mileage may vary, though I personally always perceived that as extremely convenient, as that means I had more time for my research and less time being bothered by requests to help with public relations of the university or the department. There are people being paid for doing that PR work, and I am glad about every second they save of my time.
Things get critical if there could be a considerable benefit by mentioning your name (that you expect to be absent if only the university or department name is mentioned).
- Is the figure embedded in a press release that targets an academic audience, possibly specific to your topic? In that case, it could indeed be crucial to provide direct contact info. On the other hand, if the target audience is really that specific, I would wonder why you were not asked to write the text yourself in the first place, as PR departments are not normally specialized in accurately conveying very specific information on research.
- And even if this is the case, consider the goal the university is trying to achieve - is it meant as a here-and-now info (so getting in touch with you is realistic), or is it supposed to say "This is what we did in field X in 2015.", which will then be provided as a proof for the permanent activity in your field when applying for a project grant long after you personally have left that university?
- On the other hand, is the press release rather for a general audience? In such a case, figures are often not expected to be understood in depth, and are rather meant to convey a general sense of awe for the "pretty colourful things that are produced at the university". Note that this includes both public settings (newspaper articles for everyone) and professional settings (funding reports that will be checked by financial people who do not have the slightest idea about the actual content of the research and who just want to see that something is being done that justifies the expenses for staff and equipment).
Lastly, it can be considered a very similar situation to how other products are attributed. Have a look into the About boxes of Microsoft Visual Studio or Google Chrome - they only say that they're by Microsoft and Google, respectively. Likewise, product description websites such as this, this, or this merely provide the company name as the only form of attribution. The single developers or designers are not listed, but if there is any reason to contact them, that contact can certainly be established by contacting the indicated organization.