How to change the plotstyle in mathematica?

  • Context: Mathematica 
  • Thread starter Thread starter KFC
  • Start date Start date
  • Tags Tags
    Change Mathematica
Click For Summary
SUMMARY

The discussion focuses on altering the plot style in Mathematica when using the Show function with a pre-existing graph object. The user successfully modifies the plot label using the command Show[G, PlotLabel->"Some title"], but encounters issues when attempting to change the plot style with Show[G, PlotStyle->{Thick}]. A workaround is provided using ToExpression and Insert to modify the thickness of the plot lines directly.

PREREQUISITES
  • Familiarity with Mathematica syntax and functions
  • Understanding of the Show function in Mathematica
  • Knowledge of plot styling options in Mathematica
  • Experience with manipulating expressions in Mathematica
NEXT STEPS
  • Explore the use of the Show function in Mathematica for combining graphics
  • Learn about different plot styling options available in Mathematica
  • Investigate the ToExpression function and its applications in Mathematica
  • Research advanced techniques for modifying graphics objects in Mathematica
USEFUL FOR

Mathematica users, data visualizers, and anyone looking to enhance the presentation of graphical outputs in their notebooks.

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}}]]]
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K