New answers tagged

1

There's a easier way to position elements by using Dynamic locator. Let us define some constants to be used later. pt = Scaled[{0.5, 0.5}]; (*initial position of label1*) pt1 = Scaled[{0.5, 0.5}]; (*initial position of label2*) pt2 = Scaled[{0.5, 0.5}]; (*initial position of label3*) {w, h} = {400, 250}; (*width & height*) {{l, r1}, {b, ...


2

How can I just directly assign positions? You can do it manually by creating Graphics3D text objects and positioning them alongside the plot. You can specify their coordinates using Scaled coordinates, Show[ Plot3D[Evaluate[ p[r/100, c, n, 1]^-1*D[p[r/100, c, n, 1], r] /. r -> 6], {n, 1, 20}, {c, 0, 0.1}], Graphics3D[Text["years", ...


2

I would suggest manual positioning of your labels with Epilog: ListPlot3D[ {{2, 4, 4, 4, 4}, {2, 4, 5, 5, 4}, {2, 5, 6, 6, 5}, {3, 5, 6, 7, 6}, {3, 5, 6, 7, 6}}, Epilog -> {Text["U [V]", {-0.1, 0.85}], Text["\[Omega] [rpm]", {0.2, 0}]}, AxesLabel -> {None, None, Rotate["category", 90 Degree]}, ViewPoint -> {0.8 Pi, -1.7 Pi, 0.7 Pi} ]


0

Note - The code below lets you access your data from the file name but it does not exactly do what you want. Lets say you have some data files named {file1.dat,file2.dat,file3.dat}. Keep the notebook with the code below in the same directory. SetDirectory[NotebookDirectory[]]; aLLfiles = FileNames[NotebookDirectory[] <> "*.dat"]; Table[ ...


2

To see how to extract information from filenames see this question. Notice that indexed variables, as described in the answers to this question may be more advisable than customized names created as in my answer. All that said, You can get the filenames (JPG in this example) fn = FileNames["IMG*.jpg"] {"IMG_20150417_103421814.jpg", ...


2

You can use Symbol and Formal Symbols. With[{\[FormalS] = Symbol["x"]}, \[FormalS] = 4]; x (* 4 *) For your case: filename = "file1"; With[{\[FormalS] = Symbol[filename]}, \[FormalS] = Import[filename <> ".dat"];] A symbol file1 is created by Symbol and formal s is used to hold it. Then this symbol (file1) is assigned the import. You can then ...


2

@Kuba's solution solved OP's problem, but I thought I would give an answer that doesn't use Overlay. Mainly I dislike Overlay because the result is not a Graphics object. Overlay essentially needs to be the last step, because you can't combine the result with anything else using Show or the like. Using the function extraAxisPlot, defined in this post, you ...



Top 50 recent answers are included