Generate plot coordinates for TikZ draw commandWhen using GraphPlot with an adjacency matrix, how can I make...
Has any spacecraft ever had the ability to directly communicate with civilian air traffic control?
Pressure to defend the relevance of one's area of mathematics
Confused by notation of atomic number Z and mass number A on periodic table of elements
Was it really necessary for the Lunar Module to have 2 stages?
Is there any limitation with Arduino Nano serial communication distance?
What is the incentive for curl to release the library for free?
Reverse the word in a string with the same order in javascript
Killing undead fish underwater
Modify locally tikzset
Is it possible to measure lightning discharges as Nikola Tesla?
Can someone publish a story that happened to you?
What is the difference between `a[bc]d` (brackets) and `a{b,c}d` (braces)?
Is it possible to dynamically set properties of an `Object` using Apex?
What is the most expensive material in the world that could be used to create Pun-Pun's lute?
Smart diagram in Mathematica
Mac Pro install disk keeps ejecting itself
Minimum value of 4 digit number divided by sum of its digits
How can I record the screen and the rear camera on an iPhone simultaneously?
Feels like I am getting dragged in office politics
What does YCWCYODFTRFDTY mean?
Is this a realistic set of world maps?
Any examples of headwear for races with animal ears?
Is creating your own "experiment" considered cheating during a physics exam?
Can solid acids and bases have pH values? If not, how are they classified as acids or bases?
Generate plot coordinates for TikZ draw command
When using GraphPlot with an adjacency matrix, how can I make Mathematica draw exactly one self loop for any non-zero weight?Plot in cylindrical coordinatesContour Plot in Cylindrical CoordinatesPackage for nonlinear plot coordinatesPlot region from given coordinatesPlot command yields wrong value?Manipulate Command and PlotDo with Plot commandPlot in polar coordinatesplot command for two variables
$begingroup$
Is there some clever way to generate a TikZ plot sequence of draw coordinates in Mathematica? The following commands works fairly well
y[x_] := Log[2, (2 x - 200)/(x - 200)]
Table[{i, y[i]}, {i, 201, 2000, 10}] // N
but results in the output
{{201., 7.65821}, {211., 4.33498},...
I can post-process it in a text editor but it would better if it could be output in Mathematica as
(201., 7.65821)--
(211., 4.33498)--
(221., 3.52655)--
(231., 3.07923)--
(241., 2.78200)--
...
or something similar, to be easily used with the TikZ draw-command. I could loop through the list and 'format';
Clear[i, y];
y[x_] := Log[2, (2 x - 200)/(x - 200)];
coordinates = Table[{i, y[i]}, {i, 201, 2000, 10}] // N;
tikzlist = {};
For[i = 1, i <= Length[coordinates], i++,
x = coordinates[[i]][[1]];
y = coordinates[[i]][[2]];
tikzlist =
tikzlist <> "(" <> ToString[x] <> "," <> ToString[y] <> ")--";
]
tikzlist = StringTake[tikzlist, StringLength[tikzlist] - 2] <> ";"
but perhaps there is some shorter one-line command that does the job better and more efficiently. TIA.
plotting
$endgroup$
add a comment |
$begingroup$
Is there some clever way to generate a TikZ plot sequence of draw coordinates in Mathematica? The following commands works fairly well
y[x_] := Log[2, (2 x - 200)/(x - 200)]
Table[{i, y[i]}, {i, 201, 2000, 10}] // N
but results in the output
{{201., 7.65821}, {211., 4.33498},...
I can post-process it in a text editor but it would better if it could be output in Mathematica as
(201., 7.65821)--
(211., 4.33498)--
(221., 3.52655)--
(231., 3.07923)--
(241., 2.78200)--
...
or something similar, to be easily used with the TikZ draw-command. I could loop through the list and 'format';
Clear[i, y];
y[x_] := Log[2, (2 x - 200)/(x - 200)];
coordinates = Table[{i, y[i]}, {i, 201, 2000, 10}] // N;
tikzlist = {};
For[i = 1, i <= Length[coordinates], i++,
x = coordinates[[i]][[1]];
y = coordinates[[i]][[2]];
tikzlist =
tikzlist <> "(" <> ToString[x] <> "," <> ToString[y] <> ")--";
]
tikzlist = StringTake[tikzlist, StringLength[tikzlist] - 2] <> ";"
but perhaps there is some shorter one-line command that does the job better and more efficiently. TIA.
plotting
$endgroup$
add a comment |
$begingroup$
Is there some clever way to generate a TikZ plot sequence of draw coordinates in Mathematica? The following commands works fairly well
y[x_] := Log[2, (2 x - 200)/(x - 200)]
Table[{i, y[i]}, {i, 201, 2000, 10}] // N
but results in the output
{{201., 7.65821}, {211., 4.33498},...
I can post-process it in a text editor but it would better if it could be output in Mathematica as
(201., 7.65821)--
(211., 4.33498)--
(221., 3.52655)--
(231., 3.07923)--
(241., 2.78200)--
...
or something similar, to be easily used with the TikZ draw-command. I could loop through the list and 'format';
Clear[i, y];
y[x_] := Log[2, (2 x - 200)/(x - 200)];
coordinates = Table[{i, y[i]}, {i, 201, 2000, 10}] // N;
tikzlist = {};
For[i = 1, i <= Length[coordinates], i++,
x = coordinates[[i]][[1]];
y = coordinates[[i]][[2]];
tikzlist =
tikzlist <> "(" <> ToString[x] <> "," <> ToString[y] <> ")--";
]
tikzlist = StringTake[tikzlist, StringLength[tikzlist] - 2] <> ";"
but perhaps there is some shorter one-line command that does the job better and more efficiently. TIA.
plotting
$endgroup$
Is there some clever way to generate a TikZ plot sequence of draw coordinates in Mathematica? The following commands works fairly well
y[x_] := Log[2, (2 x - 200)/(x - 200)]
Table[{i, y[i]}, {i, 201, 2000, 10}] // N
but results in the output
{{201., 7.65821}, {211., 4.33498},...
I can post-process it in a text editor but it would better if it could be output in Mathematica as
(201., 7.65821)--
(211., 4.33498)--
(221., 3.52655)--
(231., 3.07923)--
(241., 2.78200)--
...
or something similar, to be easily used with the TikZ draw-command. I could loop through the list and 'format';
Clear[i, y];
y[x_] := Log[2, (2 x - 200)/(x - 200)];
coordinates = Table[{i, y[i]}, {i, 201, 2000, 10}] // N;
tikzlist = {};
For[i = 1, i <= Length[coordinates], i++,
x = coordinates[[i]][[1]];
y = coordinates[[i]][[2]];
tikzlist =
tikzlist <> "(" <> ToString[x] <> "," <> ToString[y] <> ")--";
]
tikzlist = StringTake[tikzlist, StringLength[tikzlist] - 2] <> ";"
but perhaps there is some shorter one-line command that does the job better and more efficiently. TIA.
plotting
plotting
asked 4 hours ago
mf67mf67
1196
1196
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
You can use TextString
with its ListFormat
option to directly format the list as needed, without any postprocessing:
TextString[
TextString[#, ListFormat -> {"(", ", ", ")"}] & /@ tab1,
ListFormat -> {"", "--n", ""}
]
(*
(201., 7.65821)--
(211., 4.33498)--
(221., 3.52655)--
(231., 3.07923)--
(241., 2.782)--
…
*)
$endgroup$
$begingroup$
That's even better !
$endgroup$
– High Performance Mark
4 hours ago
add a comment |
Your Answer
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f197241%2fgenerate-plot-coordinates-for-tikz-draw-command%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
$begingroup$
You can use TextString
with its ListFormat
option to directly format the list as needed, without any postprocessing:
TextString[
TextString[#, ListFormat -> {"(", ", ", ")"}] & /@ tab1,
ListFormat -> {"", "--n", ""}
]
(*
(201., 7.65821)--
(211., 4.33498)--
(221., 3.52655)--
(231., 3.07923)--
(241., 2.782)--
…
*)
$endgroup$
$begingroup$
That's even better !
$endgroup$
– High Performance Mark
4 hours ago
add a comment |
$begingroup$
You can use TextString
with its ListFormat
option to directly format the list as needed, without any postprocessing:
TextString[
TextString[#, ListFormat -> {"(", ", ", ")"}] & /@ tab1,
ListFormat -> {"", "--n", ""}
]
(*
(201., 7.65821)--
(211., 4.33498)--
(221., 3.52655)--
(231., 3.07923)--
(241., 2.782)--
…
*)
$endgroup$
$begingroup$
That's even better !
$endgroup$
– High Performance Mark
4 hours ago
add a comment |
$begingroup$
You can use TextString
with its ListFormat
option to directly format the list as needed, without any postprocessing:
TextString[
TextString[#, ListFormat -> {"(", ", ", ")"}] & /@ tab1,
ListFormat -> {"", "--n", ""}
]
(*
(201., 7.65821)--
(211., 4.33498)--
(221., 3.52655)--
(231., 3.07923)--
(241., 2.782)--
…
*)
$endgroup$
You can use TextString
with its ListFormat
option to directly format the list as needed, without any postprocessing:
TextString[
TextString[#, ListFormat -> {"(", ", ", ")"}] & /@ tab1,
ListFormat -> {"", "--n", ""}
]
(*
(201., 7.65821)--
(211., 4.33498)--
(221., 3.52655)--
(231., 3.07923)--
(241., 2.782)--
…
*)
answered 4 hours ago
Lukas LangLukas Lang
7,53511032
7,53511032
$begingroup$
That's even better !
$endgroup$
– High Performance Mark
4 hours ago
add a comment |
$begingroup$
That's even better !
$endgroup$
– High Performance Mark
4 hours ago
$begingroup$
That's even better !
$endgroup$
– High Performance Mark
4 hours ago
$begingroup$
That's even better !
$endgroup$
– High Performance Mark
4 hours ago
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f197241%2fgenerate-plot-coordinates-for-tikz-draw-command%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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