0
$\begingroup$

So basically I have 21 plots, each one looks likeenter image description here

Now, I want to replot this from 200 to 500 only, here's what I did:

In[8]:= data = Table[Import[name[[i, j]]], {i, 1, 21}, {j, 1, 51}];
        Dimensions[data[[1,1]]]
        {499,2}

In[12]:= Table[ListPlot[data[[i]]], {i, 1, 21}, PlotRegion -> {{150, 500}, {0.050, 0.060}}]

Then I received the error Iterator {PlotRegion->{{150,500},{0.05,0.06}}} does not have appropriate bounds. I checked the >> error cause, it seems the iteration bound is not a real number and so cannot be reached using the default step size. Much appreciated if some can give me a hint?

$\endgroup$
  • $\begingroup$ I'm not exactly sure whether you want 21 data sets plotted in one plot or 21 plots, but you've got Table[ListPlot[], {i, 1, 21}, PlotRegion ->...] and the PlotRegion ->... is being passed to Table[] in the position of an iterator (like {i, 1, 21}). You might want Table[ListPlot[.., PlotRange ->..], {i, 1, 21}], if you want 21 separate plots. $\endgroup$ – Michael E2 Oct 16 '16 at 21:23
  • $\begingroup$ Ah, I see the mistake I made, PlotRegion/PlotRange must be within the ListPlot, thanks for pinpointing it out! $\endgroup$ – Gvxfjørt Oct 16 '16 at 21:35
  • $\begingroup$ I want 21 plots, but that can be easily obtained by using Table, ln[8] was basically to import each individual files, as I have 21*50 files and I want to plot 21 graphs with 50 data sets each, that's how I got the diagram in the question, hope the explanation is clear. And thanks for the help again! $\endgroup$ – Gvxfjørt Oct 16 '16 at 21:45
0
$\begingroup$

Thanks to @Michael for pinpointing out the trivial mistake

In[12]:= Table[ListPlot[data[[i]],, PlotRegion -> {{150, 500}, {0.050, 0.060}}], {i, 1, 21}]

shall solve the issue.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.