Category Archives: Cooking

Inkscape and Grace oddities for science

Here’s a quick post about a couple of oddities and problems I encountered recently in Inkscape and Grace (on a Mac) in using them for preparing scientific plots. This kind of stuff isn’t especially well-documented online — it seems like people using these programs for this purpose often figure out a way that works for them and keep quiet about it. Also Grace in particular isn’t being developed at too fast a pace right now. Here we go:

  • Exporting an EPS (or PDF or SVG) from Grace and then importing the file into Inkscape results in the fonts being changed from Times (Grace’s default) to some horrible sans-serif font in Inkscape, and the spacing being all screwed up. As explained and solved here (in relation to Matlab) this happens because Inkscape can’t access the Times font used by Grace (although weirdly it knows `Times New Roman’ which looks the same). So when it looks for the font referred to in the PDF you imported from Grace, it can’t find it, and just fudges it. Using Fondu to create a version of Times that Inkscape can use solves the issue.
  • On Mac OS X Mavericks, installing Grace either via MacPorts or from source results in a couple of problems. 1) Thanks to updated Xcode tools, invalid arguments passed to the compiler generate an error not a warning and compile can fail. Apparently you can get around this by setting an environment variable, but it didn’t work for me. In Grace the problem is an `-m486′ flag which is passed to the compiler. I opened the configure script for Grace (or in MacPorts, the associated Portfile) and removed all mention of -m486 to stop this happening. 2) Once compiled, Grace on Mavericks seems to get a segmentation fault and crash on opening. This can be fixed in a hacky way by altering all mentions of the optimisation -O2 in the configure script to -O1. Or replacing a library helps to solve it properly, but I haven’t got round to that yet.
  • In Inkscape, copy and duplicate are different. If you create nice clean text or a nice clean line or circle etc, and then ctrl-c ctrl-v like usual, the pasted object no longer seems to be like a vector and will be fuzzy when you zoom in. I’ve no idea why this is but I’m sure there’s a good reason. Anyway, using ctrl-d to duplicate instead preserves the nice vectory sharpness of the original object. Given the amount of copying and pasting that goes on in making my scientific diagrams, this was quite important to find out. This seems to make it more difficult to copy an object between different files, since ctrl-c ctrl-v works (but looks crap) whereas I can’t currently find out how to `duplicate’ an object between files.
  • On opening an EPS or PDF you made with Inkscape at a later date in Inkscape, you may find that all the separate objects you had before behave as one object so it’s hard to remove or alter individual ones. You might end up using a nasty solution like a plain white box to block out bits you want to delete but can’t. This doesn’t seem to happen Inkscape’s native SVG format. If for whatever reason you don’t have the original SVG, sometimes it’s possible to select the single object in the imported EPS and then click `Object->Ungroup’. You can do this a few times to try and separate the different elements so they can be accessed one at a time. This is useful if e.g. you want to alter a figure somehow and don’t have the SVG.

I’m sure there will be experts who know more about these various issues — I’d be grateful for any more light shed. But hopefully someone who is experiencing any of these problems might find these quick and dirty solutions helpful sometime.

Advertisements

Everyday things vaguely to do with physics: 2 — defrosting

Here’s probably quite a well-known trick, but one that has a nice physics-y explanation. Defrosting things to cook can take quite a lot of time depending what they are, requiring forward planning, leaving the thing out overnight, etc. Failing that, there’s the option of defrosting in a microwave, which can have mixed results (e.g. the outside of a thing semi-cooks in a horrible way while the inside stays frozen), and can be dangerous for things like meat because it results in large parts being very slightly, germ-growingly warm for a long time without getting hot enough to kill any germs.

A nice way of getting around this is to put whatever’s being defrosted in a bowl full of cold water. Liquid water is much better than air at conducting heat energy away from (or in this case, towards) something else. So, even though the water is no warmer than the air around it — and in fact can’t get warmer than room temperature, reducing the chances of germs growing — the thing defrosts much more quickly than it would otherwise.

This works especially well for things like vacuum-packed frozen chicken breasts or other meats, where the thing being defrosted can be in more or less direct contact with the water, without any insulating layer of air around it. Happy defrosting and subsequent cooking!

Pasta

Here’s a picture of some pasta I made recently for my friends Mazep, Emma and Tom. It’s linguine with king prawns, tomatoes, and spinach. Also, there’s quite a lot of chilli, and some ricotta which I put in right at the end. Whenever I’m doing pasta with fresh tomatoes I find it’s best to get horribly expensive ones, even at the expense of other ingredients. Or, move to Europe for a bit.