# Keep only bit of an expression unevaluated for display

Consider the code

h[x_, y_, n_] := x^2 + (y - (x^2)^(1/n))^2
g[u_] := ContourPlot[h[x, y, u] == 1, {x, -1, 1}, {y, -1, 2},
PlotLabel -> StandardForm[h[x, y, u]] == 1]
g[3.1]


which gives

I would like 1/3.1 to be displayed in the PlotLabel instead of the evaluated value 0.322581. I know about HoldForm but how do I apply it only to that bit of the expression.

• Why not to simply write it as PlotLabel -> StandardForm[h[x, y, "3.1"]] == 1? In case you do not want to do that since you intend to automate it, you might wrap u by ToString as follows: PlotLabel -> StandardForm[h[x, y, ToString[u]]] == 1. – Alexei Boulbitch Feb 1 at 10:55

You can just wrap HoldForm around u in the plot label to prevent the fraction from being evaluated:
h[x_, y_, n_] := x^2 + (y - (x^2)^(1/n))^2