Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #4138 > unrolled thread
| Started by | paulvonhippel at yahoo <paulvonhippel@yahoo.com> |
|---|---|
| First post | 2011-08-02 11:17 +0000 |
| Last post | 2011-08-03 11:12 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
LabelPlot: Changing size of CurveLabel paulvonhippel at yahoo <paulvonhippel@yahoo.com> - 2011-08-02 11:17 +0000
Re: LabelPlot: Changing size of CurveLabel Yves Klett <yves.klett@googlemail.com> - 2011-08-03 11:12 +0000
| From | paulvonhippel at yahoo <paulvonhippel@yahoo.com> |
|---|---|
| Date | 2011-08-02 11:17 +0000 |
| Subject | LabelPlot: Changing size of CurveLabel |
| Message-ID | <j18mbp$soh$1@smc.vnet.net> |
Have you used the user-defined LabelPlot function? It's pretty cool: http://library.wolfram.com/infocenter/TechNotes/4116/ But how do I change the size of the font used to display the labels in the CurveLabel option?
[toc] | [next] | [standalone]
| From | Yves Klett <yves.klett@googlemail.com> |
|---|---|
| Date | 2011-08-03 11:12 +0000 |
| Message-ID | <j1baf5$amb$1@smc.vnet.net> |
| In reply to | #4138 |
Hi,
seems slightly dated. The style options are hardcoded in the Module. A
quick´n dirty modification could be (pulling all the formatting into the
function call and replacing StyleForm with Style):
LabelPlot[func_List, {var_, varmin_, varmax_}, opts___?OptionQ] :=
Module[{crvlbl, pltopts, funclis, txt, tt, aa, f},
crvlbl = CurveLabel /. {opts} /. CurveLabel -> None;
pltopts = Select[{opts}, #[[1]] =!= CurveLabel &];
funclis =
Table[f[i][tt_] =
If[Head[func[[i]]] === Symbol && func[[i]] =!= var,
func[[i]][tt], func[[i]] /. var -> tt], {i, Length[func]}];
txt = Table[
If[Head[crvlbl[[i]]] === List,
Text[crvlbl[[i, 1]], {aa[i] = crvlbl[[i, 2]] (varmax - varmin),
f[i][aa[i]]}, {0, -1}],
Text[crvlbl[[i]], {aa[i] = (varmax - varmin)/2,
f[i][aa[i]]}, {0, -1}]], {i, Length[crvlbl]}];
Plot[Evaluate[Table[f[i][rr], {i, Length[func]}]], {rr, varmin,
varmax}, Epilog -> txt, Evaluate[pltopts]]];
myplt3 = LabelPlot[{Sin[x], Cos[2 x]/3}, {x, 0, 2 \[Pi]},
PlotStyle -> {Hue[.95], Hue[.7]},
CurveLabel -> {{Style[ToString[adf], FontFamily -> "Arial",
Background -> LightBlue, 25], 3/4}, f2[t]}]
You might want to set up a some default options for the Style calls. The
old module also calls ToString by default, which could affect advanced
expressions (fancy typesetting, grids etc.) somewhat bad.
Regards,
Yves
Am 02.08.2011 13:17, schrieb paulvonhippel at yahoo:
> Have you used the user-defined LabelPlot function? It's pretty cool:
> http://library.wolfram.com/infocenter/TechNotes/4116/
> But how do I change the size of the font used to display the labels in
> the CurveLabel option?
>
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web