How can I replace x-axis labels with pre-determined symbols? The Next CEO of Stack OverflowHow to increase the number of minor ticks in a plot?Axis Labels Disappear With ManipulatePlotting an additional axis with ticksFormatting bar charts: size and ticksHow to customize labels of a 3D plot?Show seems to forget 'logness' for Ticks of LogLogPlotHow to use Charting`ScaledFrameTicks to produce tick specifications for log-scaled plots?Custom labels in colorbarParentheses in axis labelsCalculating the sum of the lengths and plotting all curves on the same map

Can this transistor (2n2222) take 6V on emitter-base? Am I reading datasheet incorrectly?

Is there a rule of thumb for determining the amount one should accept for a settlement offer?

Read/write a pipe-delimited file line by line with some simple text manipulation

How to implement Comparable so it is consistent with identity-equality

Why do we say “un seul M” and not “une seule M” even though M is a “consonne”?

That's an odd coin - I wonder why

"Eavesdropping" vs "Listen in on"

Can I cast Thunderwave and be at the center of its bottom face, but not be affected by it?

Which acid/base does a strong base/acid react when added to a buffer solution?

Why can't we say "I have been having a dog"?

Raspberry pi 3 B with Ubuntu 18.04 server arm64: what pi version

Is it possible to make a 9x9 table fit within the default margins?

Does int main() need a declaration on C++?

Mathematica command that allows it to read my intentions

Could a dragon use its wings to swim?

Can Sri Krishna be called 'a person'?

Compensation for working overtime on Saturdays

Is it OK to decorate a log book cover?

How to compactly explain secondary and tertiary characters without resorting to stereotypes?

What did the word "leisure" mean in late 18th Century usage?

Is a distribution that is normal, but highly skewed, considered Gaussian?

Is a linearly independent set whose span is dense a Schauder basis?

What day is it again?

MT "will strike" & LXX "will watch carefully" (Gen 3:15)?



How can I replace x-axis labels with pre-determined symbols?



The Next CEO of Stack OverflowHow to increase the number of minor ticks in a plot?Axis Labels Disappear With ManipulatePlotting an additional axis with ticksFormatting bar charts: size and ticksHow to customize labels of a 3D plot?Show seems to forget 'logness' for Ticks of LogLogPlotHow to use Charting`ScaledFrameTicks to produce tick specifications for log-scaled plots?Custom labels in colorbarParentheses in axis labelsCalculating the sum of the lengths and plotting all curves on the same map










2












$begingroup$


I want to take a simple plot and change the x-axis so it appears to be measured in terms of certain symbols that are used in the physics literature. See the image below for an example.



Example band structure which illustrates the axis convention.



I will rephrase this as follows: I have some set of numerical coordinates which trace out the curves in my plot. For equal spacings on the x-axis (say once every 100 points), I want to label the line $x=100,n$ with a symbol.



I don't know how to do this. The documentation provided by Mathematica didn't help me. This doesn't seem like something done by just changing the ticks settings.










share|improve this question











$endgroup$











  • $begingroup$
    Provide sample data to work with
    $endgroup$
    – MarcoB
    7 hours ago










  • $begingroup$
    The curves can be anything. You can just plot a simple function if you like. This is just an illustration of how I want to format the axis, not real data.
    $endgroup$
    – miggle
    7 hours ago















2












$begingroup$


I want to take a simple plot and change the x-axis so it appears to be measured in terms of certain symbols that are used in the physics literature. See the image below for an example.



Example band structure which illustrates the axis convention.



I will rephrase this as follows: I have some set of numerical coordinates which trace out the curves in my plot. For equal spacings on the x-axis (say once every 100 points), I want to label the line $x=100,n$ with a symbol.



I don't know how to do this. The documentation provided by Mathematica didn't help me. This doesn't seem like something done by just changing the ticks settings.










share|improve this question











$endgroup$











  • $begingroup$
    Provide sample data to work with
    $endgroup$
    – MarcoB
    7 hours ago










  • $begingroup$
    The curves can be anything. You can just plot a simple function if you like. This is just an illustration of how I want to format the axis, not real data.
    $endgroup$
    – miggle
    7 hours ago













2












2








2





$begingroup$


I want to take a simple plot and change the x-axis so it appears to be measured in terms of certain symbols that are used in the physics literature. See the image below for an example.



Example band structure which illustrates the axis convention.



I will rephrase this as follows: I have some set of numerical coordinates which trace out the curves in my plot. For equal spacings on the x-axis (say once every 100 points), I want to label the line $x=100,n$ with a symbol.



I don't know how to do this. The documentation provided by Mathematica didn't help me. This doesn't seem like something done by just changing the ticks settings.










share|improve this question











$endgroup$




I want to take a simple plot and change the x-axis so it appears to be measured in terms of certain symbols that are used in the physics literature. See the image below for an example.



Example band structure which illustrates the axis convention.



I will rephrase this as follows: I have some set of numerical coordinates which trace out the curves in my plot. For equal spacings on the x-axis (say once every 100 points), I want to label the line $x=100,n$ with a symbol.



I don't know how to do this. The documentation provided by Mathematica didn't help me. This doesn't seem like something done by just changing the ticks settings.







plotting labeling






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 41 mins ago









m_goldberg

88k872199




88k872199










asked 8 hours ago









migglemiggle

30016




30016











  • $begingroup$
    Provide sample data to work with
    $endgroup$
    – MarcoB
    7 hours ago










  • $begingroup$
    The curves can be anything. You can just plot a simple function if you like. This is just an illustration of how I want to format the axis, not real data.
    $endgroup$
    – miggle
    7 hours ago
















  • $begingroup$
    Provide sample data to work with
    $endgroup$
    – MarcoB
    7 hours ago










  • $begingroup$
    The curves can be anything. You can just plot a simple function if you like. This is just an illustration of how I want to format the axis, not real data.
    $endgroup$
    – miggle
    7 hours ago















$begingroup$
Provide sample data to work with
$endgroup$
– MarcoB
7 hours ago




$begingroup$
Provide sample data to work with
$endgroup$
– MarcoB
7 hours ago












$begingroup$
The curves can be anything. You can just plot a simple function if you like. This is just an illustration of how I want to format the axis, not real data.
$endgroup$
– miggle
7 hours ago




$begingroup$
The curves can be anything. You can just plot a simple function if you like. This is just an illustration of how I want to format the axis, not real data.
$endgroup$
– miggle
7 hours ago










1 Answer
1






active

oldest

votes


















7












$begingroup$

This can be done using either Ticks if you're using axes or FrameTicks if you're using a frame on your plot. I made up a plot since I'm not sure the exact data matters.



Most of the code below is flair to make the graph look a bit nicer. The important bit is FrameTicks. I've told MMA to use its best judgement for 3 of the 4 sides of the graph. For plots, the order is usually left, right, bottom, top, though for certain things you can get away with only 2 arguments x-argument, y-argument.



For each side of the frame, FrameTicks is expecting a list of ticks and the label to put on those ticks, so in place of bottom from the above list, I would put something like x-value1, "x-label1", x-value2, "x-label2", .... It is also possible to specify the lengths of the ticks in this way: x-value1, "x-label1", insidelength1, outsidelength1, x-value2, "x-label2", insidelength2, outsidelength2, ....



Plot[
Piecewise[
-(x - 5)^2 + 50, 0 <= x <= 10,
-(x - 10)^2 + 25, 10 < x < 15],
x, 0, 15,
Axes -> False,
Frame -> True, False, True, False,
FrameLabel -> "E (eV)", None, "k-space", None,
FrameStyle -> Directive[16, Black],
FrameTicks ->
Automatic, Automatic, 0, "K", 5, "Γ", 10, "M", 15, "K", Automatic,
ImageSize -> 500,
Epilog ->
Dashing[0.001, 0.01],
Line[0, -1, 0, 25],
Line[5, -1, 5, 50],
Line[10, -1, 10, 25],
Line[15, -1, 15, 0]

]


Kspace plot of random function.






share|improve this answer











$endgroup$












  • $begingroup$
    Beautiful, thanks a lot! Much easier to understand in the context of using a frame.
    $endgroup$
    – miggle
    7 hours ago











Your Answer





StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "387"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f194389%2fhow-can-i-replace-x-axis-labels-with-pre-determined-symbols%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









7












$begingroup$

This can be done using either Ticks if you're using axes or FrameTicks if you're using a frame on your plot. I made up a plot since I'm not sure the exact data matters.



Most of the code below is flair to make the graph look a bit nicer. The important bit is FrameTicks. I've told MMA to use its best judgement for 3 of the 4 sides of the graph. For plots, the order is usually left, right, bottom, top, though for certain things you can get away with only 2 arguments x-argument, y-argument.



For each side of the frame, FrameTicks is expecting a list of ticks and the label to put on those ticks, so in place of bottom from the above list, I would put something like x-value1, "x-label1", x-value2, "x-label2", .... It is also possible to specify the lengths of the ticks in this way: x-value1, "x-label1", insidelength1, outsidelength1, x-value2, "x-label2", insidelength2, outsidelength2, ....



Plot[
Piecewise[
-(x - 5)^2 + 50, 0 <= x <= 10,
-(x - 10)^2 + 25, 10 < x < 15],
x, 0, 15,
Axes -> False,
Frame -> True, False, True, False,
FrameLabel -> "E (eV)", None, "k-space", None,
FrameStyle -> Directive[16, Black],
FrameTicks ->
Automatic, Automatic, 0, "K", 5, "Γ", 10, "M", 15, "K", Automatic,
ImageSize -> 500,
Epilog ->
Dashing[0.001, 0.01],
Line[0, -1, 0, 25],
Line[5, -1, 5, 50],
Line[10, -1, 10, 25],
Line[15, -1, 15, 0]

]


Kspace plot of random function.






share|improve this answer











$endgroup$












  • $begingroup$
    Beautiful, thanks a lot! Much easier to understand in the context of using a frame.
    $endgroup$
    – miggle
    7 hours ago















7












$begingroup$

This can be done using either Ticks if you're using axes or FrameTicks if you're using a frame on your plot. I made up a plot since I'm not sure the exact data matters.



Most of the code below is flair to make the graph look a bit nicer. The important bit is FrameTicks. I've told MMA to use its best judgement for 3 of the 4 sides of the graph. For plots, the order is usually left, right, bottom, top, though for certain things you can get away with only 2 arguments x-argument, y-argument.



For each side of the frame, FrameTicks is expecting a list of ticks and the label to put on those ticks, so in place of bottom from the above list, I would put something like x-value1, "x-label1", x-value2, "x-label2", .... It is also possible to specify the lengths of the ticks in this way: x-value1, "x-label1", insidelength1, outsidelength1, x-value2, "x-label2", insidelength2, outsidelength2, ....



Plot[
Piecewise[
-(x - 5)^2 + 50, 0 <= x <= 10,
-(x - 10)^2 + 25, 10 < x < 15],
x, 0, 15,
Axes -> False,
Frame -> True, False, True, False,
FrameLabel -> "E (eV)", None, "k-space", None,
FrameStyle -> Directive[16, Black],
FrameTicks ->
Automatic, Automatic, 0, "K", 5, "Γ", 10, "M", 15, "K", Automatic,
ImageSize -> 500,
Epilog ->
Dashing[0.001, 0.01],
Line[0, -1, 0, 25],
Line[5, -1, 5, 50],
Line[10, -1, 10, 25],
Line[15, -1, 15, 0]

]


Kspace plot of random function.






share|improve this answer











$endgroup$












  • $begingroup$
    Beautiful, thanks a lot! Much easier to understand in the context of using a frame.
    $endgroup$
    – miggle
    7 hours ago













7












7








7





$begingroup$

This can be done using either Ticks if you're using axes or FrameTicks if you're using a frame on your plot. I made up a plot since I'm not sure the exact data matters.



Most of the code below is flair to make the graph look a bit nicer. The important bit is FrameTicks. I've told MMA to use its best judgement for 3 of the 4 sides of the graph. For plots, the order is usually left, right, bottom, top, though for certain things you can get away with only 2 arguments x-argument, y-argument.



For each side of the frame, FrameTicks is expecting a list of ticks and the label to put on those ticks, so in place of bottom from the above list, I would put something like x-value1, "x-label1", x-value2, "x-label2", .... It is also possible to specify the lengths of the ticks in this way: x-value1, "x-label1", insidelength1, outsidelength1, x-value2, "x-label2", insidelength2, outsidelength2, ....



Plot[
Piecewise[
-(x - 5)^2 + 50, 0 <= x <= 10,
-(x - 10)^2 + 25, 10 < x < 15],
x, 0, 15,
Axes -> False,
Frame -> True, False, True, False,
FrameLabel -> "E (eV)", None, "k-space", None,
FrameStyle -> Directive[16, Black],
FrameTicks ->
Automatic, Automatic, 0, "K", 5, "Γ", 10, "M", 15, "K", Automatic,
ImageSize -> 500,
Epilog ->
Dashing[0.001, 0.01],
Line[0, -1, 0, 25],
Line[5, -1, 5, 50],
Line[10, -1, 10, 25],
Line[15, -1, 15, 0]

]


Kspace plot of random function.






share|improve this answer











$endgroup$



This can be done using either Ticks if you're using axes or FrameTicks if you're using a frame on your plot. I made up a plot since I'm not sure the exact data matters.



Most of the code below is flair to make the graph look a bit nicer. The important bit is FrameTicks. I've told MMA to use its best judgement for 3 of the 4 sides of the graph. For plots, the order is usually left, right, bottom, top, though for certain things you can get away with only 2 arguments x-argument, y-argument.



For each side of the frame, FrameTicks is expecting a list of ticks and the label to put on those ticks, so in place of bottom from the above list, I would put something like x-value1, "x-label1", x-value2, "x-label2", .... It is also possible to specify the lengths of the ticks in this way: x-value1, "x-label1", insidelength1, outsidelength1, x-value2, "x-label2", insidelength2, outsidelength2, ....



Plot[
Piecewise[
-(x - 5)^2 + 50, 0 <= x <= 10,
-(x - 10)^2 + 25, 10 < x < 15],
x, 0, 15,
Axes -> False,
Frame -> True, False, True, False,
FrameLabel -> "E (eV)", None, "k-space", None,
FrameStyle -> Directive[16, Black],
FrameTicks ->
Automatic, Automatic, 0, "K", 5, "Γ", 10, "M", 15, "K", Automatic,
ImageSize -> 500,
Epilog ->
Dashing[0.001, 0.01],
Line[0, -1, 0, 25],
Line[5, -1, 5, 50],
Line[10, -1, 10, 25],
Line[15, -1, 15, 0]

]


Kspace plot of random function.







share|improve this answer














share|improve this answer



share|improve this answer








edited 54 mins ago









m_goldberg

88k872199




88k872199










answered 7 hours ago









MassDefectMassDefect

2,135311




2,135311











  • $begingroup$
    Beautiful, thanks a lot! Much easier to understand in the context of using a frame.
    $endgroup$
    – miggle
    7 hours ago
















  • $begingroup$
    Beautiful, thanks a lot! Much easier to understand in the context of using a frame.
    $endgroup$
    – miggle
    7 hours ago















$begingroup$
Beautiful, thanks a lot! Much easier to understand in the context of using a frame.
$endgroup$
– miggle
7 hours ago




$begingroup$
Beautiful, thanks a lot! Much easier to understand in the context of using a frame.
$endgroup$
– miggle
7 hours ago

















draft saved

draft discarded
















































Thanks for contributing an answer to Mathematica Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f194389%2fhow-can-i-replace-x-axis-labels-with-pre-determined-symbols%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Invision Community Contents History See also References External links Navigation menuProprietaryinvisioncommunity.comIPS Community ForumsIPS Community Forumsthis blog entry"License Changes, IP.Board 3.4, and the Future""Interview -- Matt Mecham of Ibforums""CEO Invision Power Board, Matt Mecham Is a Liar, Thief!"IPB License Explanation 1.3, 1.3.1, 2.0, and 2.1ArchivedSecurity Fixes, Updates And Enhancements For IPB 1.3.1Archived"New Demo Accounts - Invision Power Services"the original"New Default Skin"the original"Invision Power Board 3.0.0 and Applications Released"the original"Archived copy"the original"Perpetual licenses being done away with""Release Notes - Invision Power Services""Introducing: IPS Community Suite 4!"Invision Community Release Notes

Canceling a color specificationRandomly assigning color to Graphics3D objects?Default color for Filling in Mathematica 9Coloring specific elements of sets with a prime modified order in an array plotHow to pick a color differing significantly from the colors already in a given color list?Detection of the text colorColor numbers based on their valueCan color schemes for use with ColorData include opacity specification?My dynamic color schemes

Ласкавець круглолистий Зміст Опис | Поширення | Галерея | Примітки | Посилання | Навігаційне меню58171138361-22960890446Bupleurum rotundifoliumEuro+Med PlantbasePlants of the World Online — Kew ScienceGermplasm Resources Information Network (GRIN)Ласкавецькн. VI : Літери Ком — Левиправивши або дописавши її