Mathematica How to change the plotstyle in mathematica?

AI Thread Summary
In Mathematica, when attempting to modify the style of a graph generated by an existing notebook, using the Show function with PlotStyle does not yield the desired results. While altering the title with PlotLabel works effectively, changing the plot style with PlotStyle fails. A workaround involves converting the graph to a string and then inserting the desired thickness using ToExpression and Insert functions. This method, although not elegant, successfully alters the plot style by directly manipulating the underlying representation of the graph.
KFC
Messages
477
Reaction score
4
I am running some notebook, developed by someone else, in mathematica. One of the function defined in the notebook will show a graph. Since the notebook is kinda messy and I don't want to modify it. To alter the title and/or style of the graph, I try the following

G = ShowMapping[2.3];
Show[G, PlotLabel->"Some title"];

This works great. But when I try the same way to alter the plot style, it doesn't work

Show[G, PlotStyle->{Thick}];

Any idea to alter the plot style in this case? Thanks
 
Physics news on Phys.org
It is not very elegant, but you can use:

ToExpression[
ToString[Insert[InputForm[G], Thickness[0.02], {{1, 1, 1, 3, 1}}]]]
 
Back
Top