RE: listplot and notebook directory
- To: mathgroup at smc.vnet.net
- Subject: [mg15392] RE: [mg15345] listplot and notebook directory
- From: "Ersek, Ted R" <ErsekTR at navair.navy.mil>
- Date: Tue, 12 Jan 1999 03:14:53 -0500
- Sender: owner-wri-mathgroup at wolfram.com
Maarten van der Burgt wrote:
_________________________
1. LISTPLOT
When I execute the following command the result is a listplot where the
data points ares fairly big filled black circles.
In[1]:= ListPlot[{0,2,4,9,16,25},PlotStyle->PointSize[0.05]]
The following gives a plot where the data points are joined by a line.
In[2]:= ListPlot[{0,2,4,9,16,25},PlotJoined -> True]
With the following I would expect the combination of the two. It does
however give the same results as In[2]: the
"PlotStyle->PointSize[0.05]" options doesn't seem to have any effect
here.
____________________
I don't if there is a good reason for why it works that way, but I would
get the result you want using the following.
data={0,2,4,9,16,25};
Block[{$DisplayFunction=Identity},
p1=ListPlot[data,PlotJoined->True];
p2=ListPlot[data,PlotStyle->PointSize[0.05]] ];
Show[p1,p2];
(* Graphic not shown *)
____________________
2. NOTEBOOK DIRECTORY
Is there a command which gives the directory where the current notebook
resides?
_____________________
The following should do the trick.
In[1]:=
info=NotebookInformation[SelectedNotebook[]] Out[1]=
(* a list of rules not shown. *)
In[2]:=
"FileName"/.info/.FrontEnd`FileName[dir_,FileName_,_]:>dir Out[2]=
(* The directory where the selected notebook was stored. *)
The code above was easy to come up with after reading page 248 of The
Beginner's Guide to Mathematica Version 3 (by Jerry Glynn & Theodore
Gray)
Chapter 56 of the book discusses a lot of stuff (scarcely anywhere else)
about the FrontEnd and Notebook manipulation.
_____________
Cheers,
Ted Ersek