Tag Info

Hot answers tagged

19

Basic method There appears to be a mechanism for doing just that, though I have yet to map its capabilities. As a basic example for the time being: Themes`AddThemeRules["wizard", DefaultPlotStyle -> Thread@Directive[{Purple, Orange, Hue[0.6]}, Thick], LabelStyle -> 18, AxesStyle -> White, TicksStyle -> LightGray, Background -> ...


15

It is natural to expect that the triangle marker is placed in such a way that its center of mass (center of circumcircle) coincides with the point it marks. That's how it is implemented in all major scientific plotting software, for example Origin. Some time ago I published my own implementation of triangle-based plot markers. Let us check how new markers ...


10

The issue seems to be that different PlotThemes take precedence over certain settings of BaseStyle. As noted in the new answer to this old question, BaseStyle->AbsoluteDashing[{some list}] works in the default theme because this isn't specified in the theme. Here is another odd result. If PlotTheme is "Monochrome" (or "Scientific"), the BaseStyle ...


10

You can use PolarPlot to plot the curves. As noted in the question you need to map the polar angle onto the -1 to 1 domain of the polynomials. You should also note that only the even polynomials are plotted. PolarPlot[Evaluate @ Table[n + ChebyshevT[n, t/Pi - 1], {n, 0, 40, 2}], {t, 0, 2 Pi}] To get the filling effect you can used FilledCurve: Graphics ...


10

Regarding the plot issue, I tried using HoldForm[x = Stack[_]] as an axis label to capture the stack at the moment of evaluation inside HoldForm. This revealed a problem in a helper function for dealing with units. The function Visualization`Utilities`OptionsDump`unitFormStringQ is applied to the axis labels (in a pattern test). The definition is this: ...


9

The details of the styles associated with various themes can be accessed using the function ResolvePlotThemes in the Charting context. For example: Grid[{#, Column@(Charting`ResolvePlotTheme[#, ListPlot] /. HoldPattern[PlotMarkers -> _] :> Sequence[])} & /@ {"Monochrome", "Frame", "Vibrant"}, Dividers -> All] (* removed the part ...


9

The colors alone are indexed color scheme #97: ColorData[97, "ColorList"] The colors are returned as plain RGBColor expressions; the colored squares are merely a formatting directive. You can still see the numeric data with: ColorData[97, "ColorList"] // InputForm {RGBColor[0.368417, 0.506779, 0.709798], . . ., RGBColor[0.28026441037696703, 0.715, ...


9

I'm not sure what's going on with HoldForm[InputForm[ℰ]], but I think I know what's going on with Plot. It appears at some point ReleaseHold is called because wrapping HoldForm twice fixes your problem. Plot[x^2, {x, -2, 2}, AxesLabel -> {x, HoldForm[HoldForm[InputForm[E = 1]]]}]


9

Try this: Plot[Sin[2 x], {x, -Pi, Pi}, AxesLabel -> {"This is\n an axes label", None}] And here's the same using FrameLabel instead of AxesLabel. Plot[Cos[2 x], {x, -Pi, Pi}, Frame -> True, FrameLabel -> {{"This is\n a y frame label",None}, {"This is\n an x frame label", None}}] This is covered in the documentation under Newlines ...


8

Unlike BarChart (with its default ChartLayout option setting Grouped) Histogram does not accept Grouped as a ChartLayout option value. So, we need to transform the data to get the bin heights and use transformed data in BarChart: d1 = RandomVariate[NormalDistribution[0, 1/2], 50]; d2 = RandomVariate[NormalDistribution[0, 1], 50]; d3 = ...


8

A work-around: plt = Plot[Sinc[x], {x, 0, 10}, PlotStyle -> Thick, ColorFunction -> (ColorData["AvocadoColors"][#2] &), ImageSize -> 400]; legend = Row[{Graphics[plt[[1]], AspectRatio -> 1, ImageSize -> 30], "Teste"}]; Legended[plt, legend] In Version 10, one can use PlotTheme->"Sparkline" to create the thumbnail legend: ...


8

After a rather long debugging session in our chat we could determine the reason of the problem and come up with a workaround. In short, we first tried whether the issue appears for the most basic Graphics[], which it didn't. As it turned out the gray background is introduced by using PlotLegends as in the example above. We went further by comparing ...


8

Try using MeshShading: Plot3D[ -(x - 12.5)^3, {x, 0, 25}, {y, 0, 20}, MeshShading -> {Table[Hue[x], {x, 0, 1, 1/16}]} ] The Table part generates sixteen different colors from the Hue color function. I did this because the image in this case had sixteen rows. If there are more rows than colors the colors will be reused cyclically.


8

With the data beeing data = RandomVariate[NormalDistribution[0, 1], 200]; the range of the box specified to be one sigma (approx. 68.3 %tile range) by sigma=Erf[1/Sqrt[2]] and a limit for the fences defined to be 10 % fencesLimit = 0.1 we can plot a BoxWhiskerChart using: BoxWhiskerChart[data, "Median", Method -> "BoxRange" -> (Quantile[#, ...


7

You could use base 125:- Table[125^(1 + i Log[125, 2]), {i, 0, 4}] {125, 250, 500, 1000, 2000}


7

I can't comment on exactly why HoldForm has changed but I believe your examples fall under the purview of the new Active/Inactive functionality. For example: Clear[x]; Plot[Sin[x], {x, 0, 1}, AxesLabel -> {Inactivate[x = 3], Inactive[Set][InputForm[E], 3]}] x Note, however that Inactivate can't be used with InputForm, since you want InputForm to ...


6

Use the DataRange option of ArrayPlot. If possible, it might help to force the size of the array to have the correct aspect ratio. plot1 = ArrayPlot[RandomReal[{0, 1}, {200, 100}], FrameTicks -> Automatic, DataRange -> {{0, Pi}, {0, 2 Pi}}]; plot2 = Plot[x^2, {x, 0, Pi}, PlotRange -> {0, 2 Pi}, PlotStyle -> {Thick, Red}]; Show[{plot1, ...


6

I hope this is instructive example: g[x_] := Log[2, 2 x/125] lp1 = LogLinearPlot[g[x], {x, 125/2, 8000}, Ticks -> {Table[125 2^(j - 1), {j, 0, 7}], Automatic }, BaseStyle -> {16, FontFamily -> "Arial"}] lp2 = LogLinearPlot[g[x], {x, 62.5, 8000}, Frame -> True, FrameTicks -> {Table[125 2^(j - 1), {j, 1, 7}], Automatic }, FrameStyle ...


6

You could use BaseStyle to set the Thick lines: ContourPlot[x y, {x, -1, 1}, {y, -1, 1}, ContourShading -> False, ContourStyle -> ColorData[10] /@ Range[10], BaseStyle -> Thick] Alternatively you could Thread Directive over the colour list: ContourStyle -> Thread @ Directive[Thick, ColorData[10] /@ Range[10]] which will give the same ...


6

A working way to use Directive: ContourPlot[Cos[x] + Cos[y], {x, 0, 4 Pi}, {y, 0, 4 Pi}, ContourShading -> False, ContourStyle -> Array[Directive[Thick, ColorData[10]@#] &, 10] ] Changing thickness along with color: ContourPlot[Cos[x] + Cos[y], {x, 0, 4 Pi}, {y, 0, 4 Pi}, ContourShading -> False, ContourStyle -> ...


6

Building on Pickett's answer with a few more Options: pl = Plot3D[-(x - 12.5)^3, {x, 0, 25}, {y, 0, 20}, MeshShading -> {Table[Hue[x], {x, 0, 1, 1/16}]}, BoxRatios -> 1, Boxed -> False, FaceGrids -> {{0, 1, 0}, {-1, 0, 0}, {0, 0, -1}}, FaceGridsStyle -> Directive[Thick, Gray, Dotted] ] It's not perfect but hopefully it points you ...


6

The theme generates a framed plot. You need to use FrameLabel,e.g. Plot[x^2, {x, 0, 3}, FrameLabel -> {Style[x, 30], Style[y, 30]}, PlotTheme -> "Scientific"]


6

I would use MeshShading, as shown in the documentation for ParametricPlot3D: ParametricPlot3D[{x, y, x^2 + y^2 - 5}, {y, -3, 3}, {x, -3, 3}, MeshShading -> {Directive[Opacity[.8], Blue], Directive[Opacity[.8], Yellow]}, Mesh -> {{0}}, MeshFunctions -> {#3 &}, BoundaryStyle -> {Black, Thickness[.01]}, Lighting -> "Neutral"]


6

As far as I know the specific output format of Plot (and similar commands) is not documented. I believe it has changed between versions therefore any post-processing (such as your replacement rule) must be considered potentially version dependent. As Michael comments above the documentation does state: Plot normally returns Graphics[{Line[...],...}]. ...


6

I can add to Mr.Wizards' answer that when InputForm is wrapped by any head like List (// InputForm // List) the output is much more readable because in this case it is represented in StandardForm instead of pure textual representation. StandardForm allows semantical selection by double-clicking. From the other hand it is worth to know that the width of the ...


6

Assuming that your 3D plot is in Graphics3D format, you should be able to just extract the points on the graph and use ListContourPlot. f[x_, y_] := -E^(-(1 + x)^2 - y^2)/3 + 3*E^(-x^2 - (1 + y)^2)*(1 - x)^2 - 10*E^(-x^2 - y^2)*(x/5 - x^3 - y^5); cp = ContourPlot[f[x, y], {x, -3, 3}, {y, -3, 3}, PlotRange -> All, PlotLabel -> "Computed from ...


6

Here is an example with some random data: SeedRandom@0; dat = Sort /@ RandomInteger[{200, 700}, {3, 25}]; Graphics[{Hue@.5, Opacity@.7, MapIndexed[Line@Outer[List, #, 40 #2[[1]] + {20, -20}] &, dat]}, Axes -> {True, True}, Ticks -> {Automatic, Thread@{Range[40, 3*40, 40], Range@3}}] With your data, it's a different story and it looks ...


5

n = 5; g = GridGraph[{n + 1, n + 1}]; vc = SortBy[ PropertyValue[{g, #}, VertexCoordinates] & /@ VertexList@g, Last] # - # &@(16 2.54/n); g1 = SetProperty[g, {VertexCoordinates -> vc, VertexLabels -> "Name", ImagePadding -> 10, VertexStyle -> Red, VertexSize -> Small}]; Show[g1, ...


5

Here is an idea, I'm a bit lazy to make it look as great as the IPCC one since it's mostly about tweaking the Grid and adding some text. The tricks here are: ImagePadding, Frame and its Opacity. (* data from the original figure *) num = {{1.66}, {0.48, 0.16, 0.34}, {-0.05, 0.35}, {-0.2}, {0.1}, {-0.7}}; err = {{1.49, 1.83}, {0.31 + 0.48 + 0.16, 0.37 + 0.48 ...


5

Why does Plot3D not accept its own option? But it does accept it just fine, as Kuba's comment shows: Plot3D[Exp[-x^2 - y^2], {x, -2, 2}, {y, -2, 2}, Epilog -> {PointSize[Large], Point[{.5, .5}]}, PlotRange -> All] I guess you mean to ask, Why does Plot3D not accept 3D graphics in Epilog? Because Epilog is for drawing things in front of ...



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