Tag Info

Hot answers tagged

10

I believe you want "FrontFaceColor" which can be found as a specification in this list: Graphics[{FaceForm[RGBColor[2/3, 1/3, 2/3]], EdgeForm[Black], Dynamic[{If[CurrentValue["MouseOver"], Darker @ CurrentValue["FrontFaceColor"]], Disk[]}]}] You may also find "FrontFaceOpacity" of use. Simply guessing I found that "BackFaceColor" is also ...


10

ladderF = SetProperty[EdgeDelete[GraphData[{"Ladder", #}], {1 <-> 2, (2 # - 1) <-> (2 #)}], {EdgeStyle -> Black, VertexStyle -> Black, VertexSize -> Thread[{1, 2, 2 # - 1, 2 #} -> 0]}] &; ladderF@8


8

kglr's very useful trophy from the land of undocumented functions needs to be recorded. Suppose you have the following plot: Plot[Sin[2 Pi t], {t, 0, 1}, ImageSize -> Tiny] Then you can just cut and paste {100, 54} Note, however, that Predictions`getImageSize actually reports ImageSize plus ImageMargins, as shown in the listing below. ...


8

n = 10; GridGraph[{n + 2, 2}, EdgeStyle -> {1 <-> n + 3 -> Opacity[0], n + 2 <-> 2 n + 4 -> Opacity[0]}, BaseStyle -> Black, VertexShape -> {1 -> Null, n + 2 -> Null, n + 3 -> Null, 2 n + 4 -> Null}]


7

Alright, I managed to borrow a computer. Here's an implementation of my suggestion: ellipseIntersections[mat1_?MatrixQ, mat2_?MatrixQ] /; Dimensions[mat1] == Dimensions[mat2] == {2, 3} := {\[FormalX], \[FormalY]} /. RootReduce[Solve[Flatten[Map[ GroebnerBasis[Append[Thread[{\[FormalX], \[FormalY]} == #], ...


6

n = 9; Graphics[ {Line[{{{1, 0}, {1, n}}, {{2, 0}, {2, n}}}], Line@#, PointSize[0.2], Point /@ #} & @ Table[{x, y}, {y, n - 1}, {x, 2}] ]


5

I don't know a way to export a figure with different resolutions for different elements, the term "resolution" normally applies to the whole figure. You have a 350 printer's points wide figure which you seemingly wish to export with resolution 1200 dpi. This means that you wish to export a figure with width Round[1200*(350/72)] 5833 pixels. Not every ...


4

As said in the comment by J.M, with the help of Graphics`Mesh`FindIntersections However, this method with lose the tangent points newSolution[mat1_, mat2_] := Module[{graph, pts, start1, start2}, graph = ParametricPlot[ {mat1.{Sin[θ], Cos[θ], 1}, mat2.{Sin[θ], Cos[θ], 1}}, {θ, 0, 2 Pi},Epilog -> {Point[{.1, .2}]}]; start1 = ...


4

You can also approach this using images (rather than graphics). The command ColorCombine places image a in the red channel, b in the green channel, and c in the blue channel: Nx = 10; Ny = 10; a = Table[RandomReal[], {i, 1, Nx}, {j, 1, Ny}]; b = Table[RandomReal[], {i, 1, Nx}, {j, 1, Ny}]; c = Table[RandomReal[], {i, 1, Nx}, {j, 1, Ny}]; ...


4

Or, if you want to produce a Graphics directly, these produce identical results: Graphics@Raster@Transpose[{a, b, c}, {3, 1, 2}] Graphics@Raster[MapThread[List, {a, b, c}, 2]]


3

See this question and answer, since this is a duplicate, I think. Part of the problem has to do with code formatting, so I've answered anyway. Here is a simple example of what you might want. For the purposes of illustration, I have defined p1 = Plot[x^2, {x, 0, 1}]; p2 = Plot[x, {x, 0, 1}]; Then: Labeled[ Show[p1, p2 , ImageSize -> Large , ...


3

Will this work for you? fticks[min_, max_] := Table[If[FractionalPart[i] == 0., {i, Round@i, 0.02}, {i, ""}], {i, Floor[min], Ceiling[max], 0.1}] Graphics[{EdgeForm[Opacity[0.5]], Opacity[0.75], ColorData[24, 6], Disk[{1, 0.5}, {1, 0.5}]}, Frame -> True, PlotRangePadding -> 0.5, ImagePadding -> 30, FrameTicks -> {{Automatic, ...


3

CorelDRAW is not a PostScript viewer. Its ability to import EPS files has serious limitations and is not guaranteed to preserve the original appearance of the figure. One workaround is to place the EPS file inside of the CorelDRAW document instead of importing it but it has a drawback: you will see only EPS preview, not the actual content of the EPS file. ...


3

It is as simple as Nx = 10; Ny = 10; a = Table[RandomReal[], {i, 1, Nx}, {j, 1, Ny}]; b = Table[RandomReal[], {i, 1, Nx}, {j, 1, Ny}]; c = Table[RandomReal[], {i, 1, Nx}, {j, 1, Ny}]; ArrayPlot[Transpose[{a, b, c}, {3, 1, 2}], ColorFunction -> RGBColor] Now you can set ColorFunction -> RGBColor and you probably want to look into ...


3

g = Graphics[{PointSize[.02], Point[{9, 5}], Point[{2, -5}], Point[{5, 5}], Point[{3, 6}], Point[{1, 1}], Point[{5, -7}], Point[{-7, 4}], Point[{6, -10}], Point[{-6, -2}], Point[{0, 8}], Point[{1, 4}], Line[{{1, 4}, {2, 5}}], Point[{2, 5}]}, AspectRatio -> Automatic]; g /. Point -> (Circle[#, .5] &)


3

Another Method with the hep of J.M.'s suggestion use GroebnerBasis[] to produce the implicit Cartesian equations of the two ellipses, and feed those equations to Solve[]. $$\begin{cases} x=a_1 \text{sin$\theta $}+b_1 \text{cos$\theta $}+c_1 \\ y=d_1 \text{sin$\theta $}+e_1 \text{cos$\theta $}+f_1 \\ \end{cases}$$ $\Rightarrow$ $$ ...


3

Just add a replacement at the end: Graphics[{Arrowheads[Norm@#2/0.0001], Arrow[{#1, #1 + #2}]} & @@@ listb] /. {_Arrowheads, Arrow[{a_, b_}] /; Norm[a - b] <= 10^-7} -> {} Update The problem seems to be a dot at the end of the arrow under certain conditions. a = 10^-8; listb = {{{0, 0}, {2.1*a, -2.1*a}}, {{1, 0}, {2.1*a, 2.1*a}}}; ...


2

How about Chop-ing the Arrowheads size to zero below a certain threshold? {Arrowheads[Chop[Norm@#2/0.0001, 1/100]], Arrow[{#1, #1 + #2}]} & @@@ listb


2

Here's my take. You can use either newVisibleSpectrum[] or myVisibleSpectrum[] as the underlying ColorFunction; I'll use the latter. (* smooth step function *) smoothStep3 = Compile[{{a, _Real}, {b, _Real}, {x, _Real}}, With[{t = Min[Max[0, (x - a)/(b - a)], 1]}, t*t*(3 - 2 t)], ...


2

pts = {{{1, 0}, {0, 1}}, {{3, 2}, {1, 0}}, {{0, 5}, {3, 2}}, {{-5, 0}, {0, 5}}, {{3, -8}, {-5, 0}}, {{16, 5}, {3, -8}}, {{-5, 26}, {16, 5}}, {{-39, -8}, {-5, 26}}}; aF = With[{scale = #}, Graphics[{Arrowheads[scale Norm[Subtract @@ ##]], Arrow@#} & /@ #2]] &; aF[1/300, pts]


2

Use Export gg = GraphicsGrid[Table[Plot[a*x^n, {x, 0, 1}], {n, 2}, {a, 2}]]; Export["test.jpg", gg]; Import["test.jpg"] You can use other formats such as "test.gif" or "test.png"


2

I think your syntax is wrong. Try the following Export[pathWithFileName, mmaImageName, "EPS"], where pathWithFileName contains the path and the name of the exported file i.e. "path/filename.eps". In my answer the option "EPS" is not necessarily needed.


1

The issue, as I understand it, is to display a graphic with its ImageSize proportional to its "real" size. So, in an ideal world one would use something like plt=Graphics[ ... ]; plt=Show[plt, ImageSize -> AbsoluteOptions[plt, RealSize][[1,2]]/scalefactor] The problems are, there may be no Option equivalent to RealSize and, if there is, ...


1

Your problem arises from another Graphics option,PlotRange, having the default value Automatic, which gives each Graphics object its own plot range. To get what you want you will need to force each Graphics object to have the same plot range. Here is something that works for your example. I have made it a little more general than needed because I think you ...


1

ListPlot[Table[RandomReal[], {20}, {2}], AxesLabel -> {"x", "y"}] ListPlot[ReIm /@ Table[RandomReal[] + I RandomReal[], {20}], AxesLabel -> {"Re", "Im"}] If you want arrows: Graphics[Arrow /@ ({{0, 0}, #} & /@ ReIm /@ Table[ RandomReal[{-1, 1}] + I RandomReal[{-1, 1}], {20}]), Axes -> True]


1

You may do as follows. The function below shows a single trajectory: traj1[eq1_, eq2_, point_, col_, tmax_, n_] := Module[{p0, p1, p2, p3, tau, s}, eq3 = x[0] == point[[1]]; eq4 = y[0] == point[[2]]; s = NDSolve[{eq1, eq2, eq3, eq4}, {x, y}, {t, tmax}, Method -> "StiffnessSwitching"]; tau = ...



Only top voted, non community-wiki answers of a minimum length are eligible